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

Fix for #16882: Generated CMake build when using tools.build.linker_scripts #16883

Merged
merged 7 commits into from
Aug 28, 2024
4 changes: 2 additions & 2 deletions conan/tools/cmake/toolchain/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class LinkerScriptsBlock(Block):
# Add linker flags from tools.build:linker_scripts conf

message(STATUS "Conan toolchain: Defining linker script flag: {{ linker_script_flags }}")
string(APPEND CONAN_EXE_LINKER_FLAGS {{ linker_script_flags }})
string(APPEND CONAN_EXE_LINKER_FLAGS " {{ linker_script_flags }}")
""")

def context(self):
Expand All @@ -265,7 +265,7 @@ def context(self):
linker_scripts = [linker_script.replace('\\', '/') for linker_script in linker_scripts]
linker_scripts = [relativize_path(p, self._conanfile, "${CMAKE_CURRENT_LIST_DIR}")
for p in linker_scripts]
linker_script_flags = ['-T"' + linker_script + '"' for linker_script in linker_scripts]
linker_script_flags = ['-T' + linker_script for linker_script in linker_scripts]
photex marked this conversation as resolved.
Show resolved Hide resolved
return {"linker_script_flags": " ".join(linker_script_flags)}


Expand Down