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

Adding support for ar and ld variables on cmake-toolchain #16541

Draft
wants to merge 3 commits into
base: develop2
Choose a base branch
from

Conversation

ErniGH
Copy link
Contributor

@ErniGH ErniGH commented Jun 25, 2024

Changelog: Fix: Fix ar and ld flags for cmake toolchain
Docs: https://github.com/conan-io/docs/pull/XXXX

Close: #16517

CMAKE__LINK_EXECUTABLE

CMAKE_AR

@ErniGH ErniGH requested review from czoido and jcar87 June 25, 2024 08:58
@czoido czoido added this to the 2.5.0 milestone Jun 25, 2024
@ErniGH ErniGH marked this pull request as draft June 25, 2024 09:01
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any risk of breaking by defining these CMake variables that were not defined before? Like someone defining compiler_executables for ar/ld, that were only used in autotools?

@@ -865,7 +871,9 @@ def context(self):
# To set CMAKE_<LANG>_COMPILER
if comp in compilers_by_conf:
compilers[lang] = compilers_by_conf[comp]
return {"compilers": compilers}
return {"compilers": compilers,
"cmake_ar": compilers_by_conf["ar"] if "ar" in compilers_by_conf else None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it enough compilers_by_conf.get("ar")?

@@ -289,12 +289,12 @@ def __init__(self, conanfile, backend=None, native=False):
# PR related: https://github.com/mesonbuild/meson/pull/6457
#: Defines the Meson ``c_ld`` variable. Defaulted to ``CC_LD``
#: environment value
self.c_ld = build_env.get("CC_LD")
self.c_ld = compilers_by_conf.get("ld") or self._sanitize_env_format(build_env.get("CC_LD"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need to update the PR title and changelog if this affects Meson too

@memsharded memsharded modified the milestones: 2.5.0, 2.6.0 Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] compiler_executables ar not properly set
3 participants