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

Consider the Visual Studio path for Ninja #120

Merged
merged 2 commits into from
Nov 3, 2024

Conversation

MarkSchofield
Copy link
Owner

WindowsToolchain used to download Ninja if it was specified as the CMake Generator but wasn't present on the system. That functionality was moved to WindowsCMake (to give WindowsToolchain more focused responsibilities), but #99 called out that the functionality in WindowsCMake didn't consider the Visual Studio installed version of Ninja. The responsibility of the two projects - WindowsToolchain and WindowsCMake made reconciling things difficult; WindowsToolchain is intended to be scoped and minimally sufficient, and only perform 'toolchain'-responsibilities, WindowsCMake runs 'too late' in the CMake configuration to resolve the CMAKE_MAKE_PROGRAM. This PR proposes an alternative fix - WindowsToolchain can add the location of the "Visual Studio"-installed ninja to the CMAKE_SYSTEM_PROGRAM_PATH, which CMake will consider to find the CMAKE_MAKE_PROGRAM. By appending to CMAKE_SYSTEM_PROGRAM_PATH (as opposed to, say, CMAKE_PROGRAM_PATH), the path is considered after the environment path allowing an installed ninja to be preferred.

@MarkSchofield MarkSchofield merged commit 25f97a4 into main Nov 3, 2024
34 checks passed
@MarkSchofield MarkSchofield deleted the mschofie/ninja-search-path branch November 3, 2024 00:15
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.

1 participant