Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcre2: fix invalid pcre2-config output for static libs #20586

Merged
merged 15 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion recipes/pcre2/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ def _patch_sources(self):
replace_in_file(self, cmakelists,
"RUNTIME DESTINATION bin",
"RUNTIME DESTINATION bin BUNDLE DESTINATION bin")
# pcre2-config does not correctly include '-static' in static library names
if is_msvc(self):
replace = None
if Version(self.version) > "10.42":
replace = "configure_file(pcre2-config.in"
elif Version(self.version) >= "10.38":
replace = "CONFIGURE_FILE(pcre2-config.in"
postfix = "-static" if not self.options.shared else ""
if replace:
if self.settings.build_type == "Debug":
postfix += "d"
replace_in_file(self, cmakelists, replace, f'set(LIB_POSTFIX "{postfix}")\n{replace}')

def build(self):
self._patch_sources()
Expand Down Expand Up @@ -169,7 +181,7 @@ def package_info(self):

if self.options.build_pcre2grep:
bin_path = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bin_path))
self.output.info(f"Appending PATH environment variable: {bin_path}")
self.env_info.PATH.append(bin_path)
# FIXME: This is a workaround to avoid ConanException. zlib and bzip2
# are optional requirements of pcre2grep executable, not of any pcre2 lib.
Expand Down
2 changes: 1 addition & 1 deletion recipes/pcre2/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ def build(self):

def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
bin_path = os.path.join(self.cpp.build.bindir, "test_package")
self.run(bin_path, env="conanrun")
Loading