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

Arm64 Windows build and CETCOMPAT #6173

Closed
essial opened this issue Sep 3, 2022 · 4 comments
Closed

Arm64 Windows build and CETCOMPAT #6173

essial opened this issue Sep 3, 2022 · 4 comments
Milestone

Comments

@essial
Copy link

essial commented Sep 3, 2022

For some reason, the following code is getting triggered when building with VS2022/CMake on an Arm64 build (specifically arm64-Clang-Debug):

  # CET support was added in VS 16.7
  if(MSVC_VERSION GREATER 1926 AND NOT CMAKE_GENERATOR_PLATFORM MATCHES ARM)
    list(APPEND EXTRA_LDFLAGS_BUILD "-CETCOMPAT")
  endif()

This is causing build failures in my project (I include SDL2 as a submodule and build it with the project) due to trying to use CETCOMPAT on a non x86 platform. I do not have this issue when building on my M1 ARM natively.

@madebr
Copy link
Contributor

madebr commented Sep 3, 2022

Does replacing

if(MSVC_VERSION GREATER 1926 AND NOT CMAKE_GENERATOR_PLATFORM MATCHES ARM)

with

if(MSVC_VERSION GREATER 1926 AND CMAKE_GENERATOR_PLATFORM MATCHES "Win32|x64")

fix your build problem?

@cgutman
Copy link
Collaborator

cgutman commented Sep 3, 2022

Can you grab your CMakeCache.txt file too? That should have the value of CMAKE_GENERATOR_PLATFORM inside.

@cgutman cgutman added this to the 2.26.0 milestone Sep 3, 2022
@essial
Copy link
Author

essial commented Sep 4, 2022

@madebr That change fixed it, it builds and runs perfectly with that mod. Why would they check for "Not ARM" on a platform feature only available for x86/64?

@cgutman it's this:
CMAKE_GENERATOR_PLATFORM:INTERNAL=arm64

@slouken slouken closed this as completed in ef988fe Sep 5, 2022
@slouken
Copy link
Collaborator

slouken commented Sep 5, 2022

Fixed, thanks!

PJB3005 pushed a commit to PJB3005/SDL that referenced this issue Oct 5, 2022
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

No branches or pull requests

4 participants