2 MESSAGE(STATUS "Update Compiler Settings")
4 IF(CMAKE_COMPILER_IS_GNUCC)
9 SET(OSG_GCC_FPMATHOPT "-mfpmath=sse")
11 SET(OSG_GCC_FPMATHOPT "")
16 MESSAGE(STATUS "Apply sse2 settings")
19 STRING(REGEX MATCH "-msse2 ${OSG_GCC_FPMATHOPT}"
20 SSE2_CXX_RES ${CMAKE_CXX_FLAGS})
21 ENDIF(CMAKE_CXX_FLAGS)
24 STRING(REGEX MATCH "-msse2 ${OSG_GCC_FPMATHOPT}"
25 SSE2_C_RES ${CMAKE_C_FLAGS})
29 SET(TMP_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 ${OSG_GCC_FPMATHOPT}")
32 SET(CMAKE_CXX_FLAGS ${TMP_CXX_FLAGS}
33 CACHE STRING "OpenSG defaults" FORCE )
34 ENDIF(NOT SSE2_CXX_RES)
37 SET(TMP_C_FLAGS "${CMAKE_C_FLAGS} -msse2 ${OSG_GCC_FPMATHOPT}")
40 SET(CMAKE_C_FLAGS ${TMP_C_FLAGS}
41 CACHE STRING "OpenSG defaults" FORCE )
47 MESSAGE(STATUS "Remove sse2 settings")
50 STRING(REPLACE " -msse2 ${OSG_GCC_FPMATHOPT}" ""
51 TMP_CXX_FLAGS ${CMAKE_CXX_FLAGS})
52 ENDIF(CMAKE_CXX_FLAGS)
55 STRING(REPLACE " -msse2 ${OSG_GCC_FPMATHOPT}" ""
56 TMP_C_FLAGS ${CMAKE_C_FLAGS})
59 SET(CMAKE_CXX_FLAGS ${TMP_CXX_FLAGS}
60 CACHE STRING "OpenSG defaults" FORCE )
61 SET(CMAKE_C_FLAGS ${TMP_C_FLAGS}
62 CACHE STRING "OpenSG defaults" FORCE )
65 ENDIF(OSG_ENABLE_SSE2)
69 STRING(REGEX MATCH "__STDC_FORMAT_MACROS"
70 STDFORMAT_CXX_RES ${CMAKE_CXX_FLAGS})
71 ENDIF(CMAKE_CXX_FLAGS)
74 STRING(REGEX MATCH "__STDC_FORMAT_MACROS"
75 STDFORMAT_C_RES ${CMAKE_C_FLAGS})
78 IF(NOT STDFORMAT_CXX_RES)
79 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_FORMAT_MACROS"
80 CACHE STRING "OpenSG defaults" FORCE )
81 ENDIF(NOT STDFORMAT_CXX_RES)
83 IF(NOT STDFORMAT_C_RES)
84 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__STDC_FORMAT_MACROS"
85 CACHE STRING "OpenSG defaults" FORCE )
86 ENDIF(NOT STDFORMAT_C_RES)
92 IF(CMAKE_BUILD_TYPE STREQUAL "DebugGV" OR CMAKE_BUILD_TYPE STREQUAL "ReleaseGV")
93 SET(OSG_ADD_CXX_FLAGS " -Wall -Wextra -Wno-unused-parameter")
94 SET(OSG_ADD_C_FLAGS " -Wall -Wextra -Wno-unused-parameter")
96 IF(CMAKE_BUILD_TYPE STREQUAL "ReleaseGV")
97 SET(OSG_ADD_CXX_FLAGS " ${OSG_ADD_CXX_FLAGS} -Wno-strict-aliasing")
98 ENDIF(CMAKE_BUILD_TYPE STREQUAL "ReleaseGV")
100 SET(OSG_ADD_CXX_FLAGS )
101 SET(OSG_ADD_C_FLAGS )
104 ENDIF(CMAKE_COMPILER_IS_GNUCC)
107 IF(OSG_DISABLE_MICROSOFT_SECURE_CXXX)
108 ADD_DEFINITIONS("-D_CRT_SECURE_NO_DEPRECATE")
109 ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS")
110 ADD_DEFINITIONS("-D_CRT_NONSTDC_NO_DEPRECATE")
111 ADD_DEFINITIONS("-D_SECURE_SCL=0")
112 ADD_DEFINITIONS("-D_SCL_SECURE_NO_WARNINGS")
113 ADD_DEFINITIONS("-D_SCL_SECURE_NO_DEPRECATE")
115 IF(OSG_DISABLE_MICROSOFT_SECURE_CXXX_DEBUG)
117 IF(OSG_DISABLE_MICROSOFT_SECURE_CXXX_RELEASE)
121 IF(OSG_DISABLE_MS_ITERATOR_DEBUGGING)
122 ADD_DEFINITIONS("-D_HAS_ITERATOR_DEBUGGING=0")
123 ENDIF(OSG_DISABLE_MS_ITERATOR_DEBUGGING)