Skip to content

Comments

Align the CMAKE_TRY_COMPILE_PLATFORM_VARIABLES between *.toolchain.cmake files#151

Merged
MarkSchofield merged 1 commit intomainfrom
mschofie/try-compile
Feb 2, 2026
Merged

Align the CMAKE_TRY_COMPILE_PLATFORM_VARIABLES between *.toolchain.cmake files#151
MarkSchofield merged 1 commit intomainfrom
mschofie/try-compile

Conversation

@MarkSchofield
Copy link
Owner

Fixes #150.

#150 called out that the CMAKE_TRY_COMPILE_PLATFORM_VARIABLES value is different between Windows.Clang.toolchain.cmake and Windows.MSVC.toolchain.cmake. In this particular case CMAKE_VS_VERSION_PRERELEASE being missing meant that the 'try compile' wasn't finding the same Visual Studio instance as the Toolchain originally was, but propagating - say - VS_INSTALLATION_PATH and VS_INSTALLATION_VERSION will minimize the amount of work that the Toolchain performs within the 'try compile'.

Realistically, the toolchain files should share scripts for commonality, but that seems out-of-scope for now; that seems like it should be done as part of the file-structure reshuffling. Getting this fix in first seems more important.

I'm also adding CMAKE_WINDOWS_KITS_10_DIR to the CMAKE_TRY_COMPILE_PLATFORM_VARIABLES, so that a manually set CMAKE_WINDOWS_KITS_10_DIR propagates into the 'try compile'.

@MarkSchofield MarkSchofield merged commit f418ce7 into main Feb 2, 2026
21 checks passed
@MarkSchofield MarkSchofield deleted the mschofie/try-compile branch February 2, 2026 05:28
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.

Windows.clang.toolchain.cmake should forward CMAKE_VS_VERSION_PRERELEASE for try_compile

1 participant