Skip to content

Commit

Permalink
mysql-connector-cpp: disable bootstrap() in CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Sep 8, 2024
1 parent 70c612a commit f59bd4a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions recipes/mysql-connector-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,10 @@ def generate(self):

def _patch_sources(self):
apply_conandata_patches(self)
if is_apple_os(self):
# The CMAKE_OSX_ARCHITECTURES value set by Conan seems to be having no effect for some reason.
# This is a workaround for that.
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"),
"PROJECT(MySQL_CONCPP)",
f"PROJECT(MySQL_CONCPP)\n\nadd_compile_options(-arch {self.settings.arch})\n")
# Disable boostrap(), which is unnecessary and fragile with variables set by Conan
# https://github.com/mysql/mysql-connector-cpp/blob/9.0.0/CMakeLists.txt#L69-L71
# https://github.com/mysql/mysql-connector-cpp/blob/9.0.0/cdk/cmake/bootstrap.cmake#L55
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "bootstrap()", "")

def build(self):
self._patch_sources()
Expand Down Expand Up @@ -168,4 +166,4 @@ def package_info(self):
if is_apple_os(self) or self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.extend(["resolv"])
if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.extend(["m", "pthread"])
self.cpp_info.system_libs.extend(["m", "pthread"])

0 comments on commit f59bd4a

Please sign in to comment.