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

Allow tools.gnu:make_program to work in every case #14223

Merged
Merged
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions conan/tools/cmake/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def generate(conanfile, toolchain_file, generator, cache_variables, preset_prefi
if "CMAKE_SH" not in cache_variables:
cache_variables["CMAKE_SH"] = "CMAKE_SH-NOTFOUND"

cmake_make_program = conanfile.conf.get("tools.gnu:make_program",
default=cache_variables.get("CMAKE_MAKE_PROGRAM"))
if cmake_make_program:
cmake_make_program = cmake_make_program.replace("\\", "/")
cache_variables["CMAKE_MAKE_PROGRAM"] = cmake_make_program
cmake_make_program = conanfile.conf.get("tools.gnu:make_program",
default=cache_variables.get("CMAKE_MAKE_PROGRAM"))
if cmake_make_program:
cmake_make_program = cmake_make_program.replace("\\", "/")
cache_variables["CMAKE_MAKE_PROGRAM"] = cmake_make_program
Copy link
Member

Choose a reason for hiding this comment

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

I know this was already there, and not strictly related to this PR. But why is it a cache variable (presets) and not a toolchain one? Because it means that this is an extra things that users not using presets should remember to pass in the command line too. It would be worth checking if this works in the toolchain (probably will fail, and this is the reason it is a cache variable)


if "CMAKE_POLICY_DEFAULT_CMP0091" not in cache_variables:
cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW"
Expand Down