From ba0e526a8386564c13c0985990a1346495636a3a Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 6 Apr 2021 20:02:48 +0200 Subject: [PATCH] (#5038) mysql-connector-c: fix usage with static libc++ * mysql-connector-c: fix usage with static libc++ * fixup --- recipes/mysql-connector-c/all/conanfile.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/recipes/mysql-connector-c/all/conanfile.py b/recipes/mysql-connector-c/all/conanfile.py index 14cb4084f824f..bd749747da9c0 100644 --- a/recipes/mysql-connector-c/all/conanfile.py +++ b/recipes/mysql-connector-c/all/conanfile.py @@ -42,7 +42,7 @@ def _configure_cmake(self): self._cmake.definitions["DISABLE_SHARED"] = not self.options.shared self._cmake.definitions["DISABLE_STATIC"] = self.options.shared self._cmake.definitions["STACK_DIRECTION"] = "-1" # stack grows downwards, on very few platforms stack grows upwards - self._cmake.definitions["REQUIRE_STDCPP"] = self._stdcpp_library + self._cmake.definitions["REQUIRE_STDCPP"] = tools.stdcpp_library(self) if self.settings.compiler == "Visual Studio": if self.settings.compiler.runtime == "MD" or self.settings.compiler.runtime == "MDd": @@ -86,20 +86,11 @@ def package(self): os.remove(f) tools.rmdir(os.path.join(self.package_folder, "docs")) - @property - def _stdcpp_library(self): - libcxx = self.settings.get_safe("compiler.libcxx") - if libcxx in ("libstdc++", "libstdc++11"): - return "stdc++" - elif libcxx in ("libc++",): - return "c++" - else: - return False - def package_info(self): self.cpp_info.libs = ["libmysql" if self.options.shared and self.settings.os == "Windows" else "mysqlclient"] if not self.options.shared: - if self._stdcpp_library: - self.cpp_info.system_libs.append(self._stdcpp_library) + stdcpp_library = tools.stdcpp_library(self) + if stdcpp_library: + self.cpp_info.system_libs.append(stdcpp_library) if self.settings.os == "Linux": self.cpp_info.system_libs.append('m')