From f7bbde398237d395f0b1ff6895cf42a29e575521 Mon Sep 17 00:00:00 2001 From: cobalt2727 <60624944+cobalt2727@users.noreply.github.com> Date: Wed, 8 Feb 2023 14:46:09 -0500 Subject: [PATCH] fix ARM builds being completely broken If merged, this is the quickest approach to resolve https://github.com/STJr/SRB2/issues/513 ...alternatively, we could just remove the option altogether but I don't have the time right now to test whether it's needed or not To the best of my knowledge, this covers all possible amd64 `CMAKE_SYSTEM_PROCESSOR` values based on what I'm seeing at https://stackoverflow.com/questions/70475665/what-are-the-possible-values-of-cmake-system-processor --- src/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 251195414..cc49bc0b4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -549,8 +549,11 @@ endif() # Compatibility flag with later versions of GCC # We should really fix our code to not need this -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -mno-ms-bitfields) +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|x64|amd64|AMD64|em64t|EM64T)") + set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -mno-ms-bitfields) + endif() + set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-trigraphs) endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")