From 26fbf367d7b580cf75676e81c8eeabd9dcc4e932 Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:47:31 +0100 Subject: [PATCH] xerces-c: fix handling of nsl library (#25593) --- recipes/xerces-c/all/conanfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/xerces-c/all/conanfile.py b/recipes/xerces-c/all/conanfile.py index 057e07e361250a..a7daf64e71cdb6 100644 --- a/recipes/xerces-c/all/conanfile.py +++ b/recipes/xerces-c/all/conanfile.py @@ -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: @@ -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"