add -mfpmath=sse -msse2 compiler flags: x86/amd64
This may speed things up a little in some places, or maybe not, but should be safe as few if any users are likely to be using a CPU without SSE2.
This commit is contained in:
parent
afb1cd3dfc
commit
21926d6230
|
@ -326,12 +326,18 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF(ENABLE_LTO)
|
ENDIF(ENABLE_LTO)
|
||||||
|
|
||||||
|
unset(MY_C_OPT_FLAGS)
|
||||||
|
|
||||||
|
if(X86_32 OR AMD64)
|
||||||
|
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))
|
IF(NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3))
|
||||||
SET(MY_C_OPT_FLAGS -O2 -fomit-frame-pointer ${LTO_FLAGS})
|
SET(MY_C_OPT_FLAGS ${MY_C_OPT_FLAGS} -O2 -fomit-frame-pointer ${LTO_FLAGS})
|
||||||
ELSE()
|
ELSE()
|
||||||
# LTO and -fomit-frame-pointer generate broken binaries on Lion with XCode 4.2 tools
|
# LTO and -fomit-frame-pointer generate broken binaries on Lion with XCode 4.2 tools
|
||||||
SET(MY_C_OPT_FLAGS -O2)
|
SET(MY_C_OPT_FLAGS ${MY_C_OPT_FLAGS} -O2)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# only use -mtune=generic on PC architectures
|
# only use -mtune=generic on PC architectures
|
||||||
|
|
Loading…
Reference in New Issue