Skip to content

Specify 'CMAKE_<LANG>_COMPILER_TARGET' reflecting CMAKE_SYSTEM_PROCESSOR#157

Merged
MarkSchofield merged 1 commit intomainfrom
mschofie/cross-compile
Mar 8, 2026
Merged

Specify 'CMAKE_<LANG>_COMPILER_TARGET' reflecting CMAKE_SYSTEM_PROCESSOR#157
MarkSchofield merged 1 commit intomainfrom
mschofie/cross-compile

Conversation

@MarkSchofield
Copy link
Copy Markdown
Owner

@MarkSchofield MarkSchofield commented Mar 8, 2026

Fixes #156.

Cross-compiling with Windows.Clang.toolchain.cmake doesn't work, since clang's target defaults to the target that it was built for; there's no logic specifying a target based on CMAKE_SYSTEM_PROCESSOR. With MSVC, a different .exe is used - the path to cl.exe changes based on the target. This PR adds logic to set CMAKE_<LANG>_COMPILER_TARGET, adds presets to example and updates .github/workflows/ci.yaml to build those presets.

@MarkSchofield MarkSchofield force-pushed the mschofie/cross-compile branch from 77cc060 to 9c774e3 Compare March 8, 2026 14:34
@MarkSchofield MarkSchofield merged commit 44a12bb into main Mar 8, 2026
25 checks passed
@MarkSchofield MarkSchofield deleted the mschofie/cross-compile branch March 8, 2026 14:52
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.

Windows.Clang.toolchain.cmake doesn't cross-compile correctly

1 participant