Changeset 8284 for code/branches/kicklib2/cmake/CompilerConfigGCC.cmake
- Timestamp:
- Apr 21, 2011, 6:58:23 PM (14 years ago)
- Location:
- code/branches/kicklib2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2
- Property svn:mergeinfo changed
-
code/branches/kicklib2/cmake/CompilerConfigGCC.cmake
r7458 r8284 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 74 IF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")67 IF(NOT MINGW AND ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") 75 68 ADD_COMPILER_FLAGS("-fPIC" CACHE) 69 ENDIF() 70 71 # Use SSE if possible 72 # Commented because this might not work for cross compiling 73 #CHECK_CXX_COMPILER_FLAG(-msse _gcc_have_sse) 74 #IF(_gcc_have_sse) 75 # ADD_COMPILER_FLAGS("-msse" CACHE) 76 #ENDIF() 77 78 IF(NOT MINGW) 79 # Have GCC visibility? 80 CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" _gcc_have_visibility) 81 IF(_gcc_have_visibility) 82 # Note: There is a possible bug with the flag in gcc < 4.2 and Debug versions 83 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.2.0" _compare_result) 84 IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" OR _compare_result GREATER -1) 85 ADD_COMPILER_FLAGS("-DORXONOX_GCC_VISIBILITY -fvisibility=default -fvisibility-inlines-hidden" CACHE) 86 ENDIF() 87 ENDIF(_gcc_have_visibility) 76 88 ENDIF() 77 89
Note: See TracChangeset
for help on using the changeset viewer.