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

Remove ld and ar from tools.build:compiler_executables #16647

Merged
merged 3 commits into from
Jul 11, 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
4 changes: 1 addition & 3 deletions conan/tools/gnu/gnutoolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,13 @@ def _initialize_default_extra_env(self):
if is_msvc(self._conanfile):
extra_env_vars = {"CC": "cl -nologo",
"CXX": "cl -nologo",
"LD": "link -nologo",
"AR": "lib",
"NM": "dumpbin -symbols",
"OBJDUMP": ":",
"RANLIB": ":",
"STRIP": ":"}
# Configuration map
compilers_mapping = {"c": "CC", "cpp": "CXX", "cuda": "NVCC", "fortran": "FC",
"rc": "RC", "ld": "LD", "ar": "AR", "nm": "NM", "ranlib": "RANLIB",
"rc": "RC", "nm": "NM", "ranlib": "RANLIB",
"objdump": "OBJDUMP", "strip": "STRIP"}
# Compiler definitions by conf
compilers_by_conf = self._conanfile.conf.get("tools.build:compiler_executables", default={},
Expand Down
2 changes: 1 addition & 1 deletion conans/model/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"tools.apple:enable_visibility": "(boolean) Enable/Disable Visibility Apple Clang flags",
"tools.env.virtualenv:powershell": "If it is set to True it will generate powershell launchers if os=Windows",
# Compilers/Flags configurations
"tools.build:compiler_executables": "Defines a Python dict-like with the compilers path to be used. Allowed keys {'c', 'cpp', 'cuda', 'objc', 'objcxx', 'rc', 'fortran', 'asm', 'hip', 'ispc', 'ld', 'ar'}",
"tools.build:compiler_executables": "Defines a Python dict-like with the compilers path to be used. Allowed keys {'c', 'cpp', 'cuda', 'objc', 'objcxx', 'rc', 'fortran', 'asm', 'hip', 'ispc'}",
"tools.build:cxxflags": "List of extra CXX flags used by different toolchains like CMakeToolchain, AutotoolsToolchain and MesonToolchain",
"tools.build:cflags": "List of extra C flags used by different toolchains like CMakeToolchain, AutotoolsToolchain and MesonToolchain",
"tools.build:defines": "List of extra definition flags used by different toolchains like CMakeToolchain, AutotoolsToolchain and MesonToolchain",
Expand Down
6 changes: 0 additions & 6 deletions test/integration/toolchains/gnu/test_gnutoolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,6 @@ def build(self):
# Default values and conf ones
assert r'set "CC=clang"' in content # conf value has precedence
assert r'set "CXX=clang++"' in content # conf value has precedence
assert 'set "LD=link -nologo"' in content
assert r'set "AR=lib"' in content
assert 'set "NM=dumpbin -symbols"' in content
assert 'set "OBJDUMP=:"' in content
assert 'set "RANLIB=:"' in content
Expand Down Expand Up @@ -412,8 +410,6 @@ def generate(self):
# Prepending compiler wrappers
tc.extra_env.prepend("CC", "compile")
tc.extra_env.prepend("CXX", "compile")
tc.extra_env.prepend("AR", "ar-lib")
tc.extra_env.append("LD", "-fixed")
tc.extra_env.define("OBJDUMP", "other-value")
tc.extra_env.unset("RANLIB")
tc.generate()
Expand All @@ -424,8 +420,6 @@ def build(self):
# Default values
assert r'set "CC=compile clang"' in content
assert r'set "CXX=compile clang++"' in content
assert 'set "LD=link -nologo -fixed"' in content # appended new value
assert r'set "AR=ar-lib lib"' in content
assert 'set "NM=dumpbin -symbols"' in content
assert 'set "OBJDUMP=other-value"' in content # redefined
assert 'set "RANLIB=:"' not in content # removed
Expand Down