set default compiler flags to "-O2" in the case of MinGW
This commit is contained in:
parent
840baa2205
commit
d198e39d35
@ -41,6 +41,10 @@ set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "" FORCE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "" FORCE)
|
||||
set(CMAKE_VERBOSE OFF CACHE BOOL "Verbose mode")
|
||||
|
||||
if (MINGW)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG" CACHE STRING "")
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERBOSE)
|
||||
set(CMAKE_VERBOSE_MAKEFILE 1)
|
||||
endif()
|
||||
@ -307,13 +311,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES powerpc*)
|
||||
set(USE_O3 ON CACHE BOOL "Enable -O3 for GCC")
|
||||
set(ENABLE_POWERPC ON CACHE BOOL "Enable PowerPC for GCC")
|
||||
endif ()
|
||||
|
||||
if(X86 OR X86_64)
|
||||
# enable everything, since the available set of instructions is checked at runtime
|
||||
set(USE_O3 ON CACHE BOOL "Enable -O3")
|
||||
set(USE_FAST_MATH ON CACHE BOOL "Enable -ffast-math")
|
||||
set(ENABLE_SSE ON CACHE BOOL "Enable SSE instructions")
|
||||
set(ENABLE_SSE2 ON CACHE BOOL "Enable SSE2 instructions")
|
||||
@ -993,12 +995,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(USE_OMIT_FRAME_POINTER)
|
||||
set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -fomit-frame-pointer")
|
||||
endif()
|
||||
if(USE_O2)
|
||||
set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -O2")
|
||||
endif()
|
||||
if(USE_O3)
|
||||
set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -O3")
|
||||
endif()
|
||||
if(USE_FAST_MATH)
|
||||
set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -ffast-math")
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user