Repository navigation
Fix SHADERMAKE_TOOL building as x64 in Arm64-to-x64 cross builds - #27
Merged
Merged
Conversation
With Visual Studio, a host other than x64 inherited the parent's platform, so an x64 build on an Arm64 host built an x64 ShaderMake that ran under emulation.
Collaborator
|
Thanks. Calvin. Seems to be a good change. Merged! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
SHADERMAKE_TOOLis ON, ShaderMake is built as a separate external project so it can run during the parent build. With the Visual Studio generator, its platform was only mapped for x64 hosts (AMD64→x64). Any other host inherited the parent'sCMAKE_GENERATOR_PLATFORM. So an x64 build (-A x64) on a Windows Arm64 host produced an x64ShaderMake.exe, which then ran under emulation.The external project now targets the host platform:
ARM64whenHOST_IS_ARM64is set,x64otherwise. Non-Visual Studio generators get no platform, as before. This uses the sameHOST_IS_ARM64that already selects the DXC and Slang binaries, so the tool and the compilers it launches always match the host.Testing
Visual Studio 2022, CMake 4.4.3, full shader set of a downstream project (95 DXIL + 95 SPIR-V):
-ASHADERMAKE_TOOLbin/x64bin/x64bin/arm64bin/arm64