From f96e9e256c2d24bc007ef74f51125b3d5d5057d1 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Sun, 19 May 2024 21:22:22 -0400 Subject: [PATCH] set architecture specific march only on x86_64 explicitly setting the architecture to an x86_64 subarchitecture causes issues on other architecture systems. clang/gcc default to a generic x86_64 architecture without sse instruction support. --- CMakeLists.txt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 243ba12..18acea6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,11 +181,18 @@ target_include_directories(Zelda64Recompiled PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ) -target_compile_options(Zelda64Recompiled PRIVATE - -march=nehalem - -fno-strict-aliasing - -fms-extensions -) +if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") + target_compile_options(Zelda64Recompiled PRIVATE + -march=nehalem + -fno-strict-aliasing + -fms-extensions + ) +else() + target_compile_options(Zelda64Recompiled PRIVATE + -fno-strict-aliasing + -fms-extensions + ) +endif() if (WIN32) include(FetchContent)