Skip to content

Consider the Visual Studio path for Ninja#120

Merged
MarkSchofield merged 2 commits intomainfrom
mschofie/ninja-search-path
Nov 3, 2024
Merged

Consider the Visual Studio path for Ninja#120
MarkSchofield merged 2 commits intomainfrom
mschofie/ninja-search-path

Conversation

@MarkSchofield
Copy link
Copy Markdown
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
@MarkSchofield MarkSchofield deleted the mschofie/ninja-search-path branch November 3, 2024 00:15
InCom-0 pushed a commit to InCom-0/cmake_WindowsToolchain that referenced this pull request Mar 10, 2026
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