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.
This commit is contained in:
theofficialgman 2024-05-19 21:22:22 -04:00
parent 0b609752ce
commit f96e9e256c

View file

@ -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)