3 include(CheckCCompilerFlag)
5 if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
6 CHECK_C_COMPILER_FLAG( "-O3" XFLAGS_O3)
8 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
11 CHECK_C_COMPILER_FLAG( "-Wall -Wno-unused" XFLAGS_WARN)
13 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused")
15 CHECK_C_COMPILER_FLAG( "-std=gnu99" XFLAGS_GNU99)
17 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
21 CHECK_C_COMPILER_FLAG( "-fexcess-precision=fast" XFLAGS_EXCESS_PRECISION)
22 IF (XFLAGS_EXCESS_PRECISION)
23 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexcess-precision=fast")
24 ENDIF (XFLAGS_EXCESS_PRECISION)
26 CHECK_C_COMPILER_FLAG( "-march=native" XFLAGS_MARCH)
28 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
30 endif( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
32 MARK_AS_ADVANCED(XFLAGS_O3 XFLAGS_WARN XFLAGS_GNU99 XFLAGS_MARCH)