Changeset 8071 for code/branches/kicklib/cmake/CompilerConfigGCC.cmake
- Timestamp:
- Mar 14, 2011, 3:53:38 AM (14 years ago)
- Location:
- code/branches/kicklib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib
-
code/branches/kicklib/cmake/CompilerConfigGCC.cmake
r7458 r8071 26 26 INCLUDE(FlagUtilities) 27 27 INCLUDE(CompareVersionStrings) 28 INCLUDE(CheckCXXCompilerFlag) 28 29 29 30 # Shortcut for CMAKE_COMPILER_IS_GNUCXX and ..._GNUC … … 36 37 OUTPUT_VARIABLE GCC_VERSION 37 38 ) 38 39 # Complain about incompatibilities40 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.4.0" _compare_result)41 IF(NOT _compare_result LESS 0)42 IF(${Boost_VERSION} LESS 103700)43 MESSAGE(STATUS "Warning: Boost versions earlier than 1.37 may not compile with GCC 4.4 or later!")44 ENDIF()45 ENDIF()46 39 47 40 # GCC may not support #pragma GCC system_header correctly when using … … 72 65 73 66 # CMake doesn't seem to set the PIC flags right on certain 64 bit systems 67 # Todo: MinGW too? 74 68 IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") 75 69 ADD_COMPILER_FLAGS("-fPIC" CACHE) 70 ENDIF() 71 72 # Use SSE if possible 73 # Commented because this might not work for cross compiling 74 #CHECK_CXX_COMPILER_FLAG(-msse _gcc_have_sse) 75 #IF(_gcc_have_sse) 76 # ADD_COMPILER_FLAGS("-msse" CACHE) 77 #ENDIF() 78 79 IF(NOT MINGW) 80 # Have GCC visibility? 81 CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" _gcc_have_visibility) 82 IF(_gcc_have_visibility) 83 # Note: There is a possible bug with the flag in gcc < 4.2 and Debug versions 84 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.2.0" _compare_result) 85 IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" OR _compare_result GREATER -1) 86 ADD_COMPILER_FLAGS("-DORXONOX_GCC_VISIBILITY -fvisibility=default -fvisibility-inlines-hidden" CACHE) 87 ENDIF() 88 ENDIF(_gcc_have_visibility) 76 89 ENDIF() 77 90
Note: See TracChangeset
for help on using the changeset viewer.