Skip to content

Commit

Permalink
xerces-c: fix handling of nsl library (conan-io#25593)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcar87 authored and OMGtechy committed Dec 31, 2024
1 parent d143e1b commit 26fbf36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion recipes/xerces-c/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ def generate(self):
tc = CMakeToolchain(self)
# Because upstream overrides BUILD_SHARED_LIBS as a CACHE variable
tc.cache_variables["BUILD_SHARED_LIBS"] = "ON" if self.options.shared else "OFF"

# Prevent linking against unused found library
tc.cache_variables["NSL_LIBRARY"] = "NSL_LIBRARY-NOTFOUND"

# https://xerces.apache.org/xerces-c/build-3.html
tc.variables["network"] = self.options.network
if self.options.network:
Expand Down Expand Up @@ -172,7 +176,7 @@ def package_info(self):
if self.settings.os == "Macos":
self.cpp_info.frameworks = ["CoreFoundation", "CoreServices"]
elif self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.extend(["pthread", "nsl"])
self.cpp_info.system_libs.extend(["pthread"])

if Version(conan_version).major < 2:
self.cpp_info.names["cmake_find_package"] = "XercesC"
Expand Down

0 comments on commit 26fbf36

Please sign in to comment.