Skip to content

Commit

Permalink
(#5038) mysql-connector-c: fix usage with static libc++
Browse files Browse the repository at this point in the history
* mysql-connector-c: fix usage with static libc++

* fixup
  • Loading branch information
ericLemanissier committed Apr 6, 2021
1 parent 75a17ab commit ba0e526
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions recipes/mysql-connector-c/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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')

0 comments on commit ba0e526

Please sign in to comment.