From 4a168993dc70726a2e21f37f6631f9d847f64a56 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 20 May 2025 20:15:38 +0200 Subject: [PATCH] Special thanks to the compiler tool vendors for making it so trivial and easy to check for the CPU --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 405838fae..e4689145a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1240,6 +1240,12 @@ set_source_files_properties( common/engine/sc_man.cpp PROPERTIES OBJECT_DEPENDS set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE ) set_source_files_properties( ${GAME_NONPCH_SOURCES} common/textures/hires/hqresize.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS TRUE ) +# Disable AVX2 for the entry point as we want to do a CPU check first +if(MSVC) + if(X64) + set_source_files_properties( gamemain.cpp PROPERTIES COMPILE_FLAGS /arch:SSE2 ) + endif() +endif() if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") # [BL] Solaris requires these to be explicitly linked.