Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2022-02-03 22:20:00 +00:00
parent 8bd09c9012
commit c0bab40e9f
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 6 additions and 14 deletions

View File

@ -582,32 +582,24 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
unset(MY_C_OPT_FLAGS) unset(MY_C_OPT_FLAGS)
if(X86_32 OR X86_64)
set(MY_C_OPT_FLAGS -mfpmath=sse -msse2)
endif()
# common optimization flags # common optimization flags
if(NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)) set(MY_C_OPT_FLAGS ${MY_C_OPT_FLAGS} -O3 -fomit-frame-pointer ${LTO_FLAGS})
set(MY_C_OPT_FLAGS ${MY_C_OPT_FLAGS} -O2 -fomit-frame-pointer ${LTO_FLAGS})
else()
# LTO and -fomit-frame-pointer generate broken binaries on Lion with XCode 4.2 tools
set(MY_C_OPT_FLAGS ${MY_C_OPT_FLAGS} -O2)
endif()
# Common flags. # Common flags.
set(MY_C_FLAGS -pipe -Wno-unused-command-line-argument -Wformat -Wformat-security -feliminate-unused-debug-types) set(MY_C_FLAGS -pipe -Wno-unused-command-line-argument -Wformat -Wformat-security -feliminate-unused-debug-types)
# Optimize for Core2 and tune for Rocketlake on macOS and Zen3 for the rest # Optimize for Core2 and tune for Rocketlake on macOS and Zen3 for the rest
# on X86_64. # on X86_64.
if(X86_64) if(X86_64 OR X86_32 AND NOT XP_RELEASE)
set(MY_C_FLAGS ${MY_C_FLAGS} -march=core2) set(MY_C_FLAGS ${MY_C_FLAGS} -march=core2 -mfpmath=both -msse2 -ffast-math)
if(APPLE) if(APPLE)
set(MY_C_FLAGS ${MY_C_FLAGS} -mtune=rocketlake) set(MY_C_FLAGS ${MY_C_FLAGS} -mtune=rocketlake)
else() else()
set(MY_C_FLAGS ${MY_C_FLAGS} -mtune=znver3) set(MY_C_FLAGS ${MY_C_FLAGS} -mtune=znver3)
endif() endif()
# Optimize for pentium-mmx and tune for Core2 on X86_32. # Optimize for pentium-mmx and tune for Core2 on X86_32 for XP
elseif(X86_32) # builds.
elseif(XP_RELEASE)
set(MY_C_FLAGS ${MY_C_FLAGS} -march=pentium-mmx -mtune=core2) set(MY_C_FLAGS ${MY_C_FLAGS} -march=pentium-mmx -mtune=core2)
endif() endif()