Changeset 2588 for code/branches/buildsystem2/cmake
- Timestamp:
- Jan 12, 2009, 4:18:11 PM (16 years ago)
- Location:
- code/branches/buildsystem2/cmake
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/cmake/ConfigMSVC.cmake
r2585 r2588 26 26 # 27 27 28 ############## MSVC config################29 # Set the library director y when using precompiled tarballs for30 # the dependencies under windows (MSVC)31 ########################################### 28 ###################### MSVC config ######################## 29 # Set the library directories and special options when 30 # using Visual Studio. 31 ########################################################### 32 32 33 33 IF (MSVC) 34 34 MESSAGE(STATUS "Running on MSVC. Using customized paths and options.") 35 36 ###################### Libraries ######################## 35 37 36 38 # Determine library directory … … 54 56 SET(ENV{OPENALDIR} ${MSVC_LIBRARY_DIR}/openal-1.1) 55 57 SET(ENV{LUA_DIR} ${MSVC_LIBRARY_DIR}/lua-5.1.3) 56 SET(ENV{OGRE_HOME} "${MSVC_LIBRARY_DIR}/ogre-1.4.9;${ ORXONOX_LIBRARY_BIN_DIR}")58 SET(ENV{OGRE_HOME} "${MSVC_LIBRARY_DIR}/ogre-1.4.9;${MSVC_LIBRARY_DIR}/bin") 57 59 SET(TCL_INCLUDE_PATH ${MSVC_LIBRARY_DIR}/tcl-8.5.2/include) 58 60 SET(TCL_LIBRARY ${MSVC_LIBRARY_DIR}/tcl-8.5.2/lib/tcl85t.lib) … … 66 68 SET(ZLIB_FOUND TRUE) 67 69 70 #################### Compiler Flags ##################### 68 71 69 # Set standard compiler flags 70 SET(CMAKE_C_FLAGS "$ENV{CFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC") 71 SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC") 72 # These flags are added to the flags above 73 SET(CMAKE_C_FLAGS_DEBUG " -g -ggdb") 74 SET(CMAKE_CXX_FLAGS_DEBUG " -g -ggdb") 75 SET(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") 76 SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") 77 SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG") 78 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG") 79 SET(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG") 80 SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") 72 # /MD Minimal Rebuild 73 # /RTC1 Both basic runtime checks 74 # /MD[d] Multithreaded [debug] DLL 75 # /Zi Program Database 76 # /ZI Program Database for Edit & Continue 77 # /WX Warning Level X 78 # /wdX Disable specific warning X 79 SET(MSVC_CL_FLAGS " 80 /D WIN32 /D __WIN32__ /D _WIN32 /D _WINDOWS 81 /D BOOST_ALL_DYN_LINK 82 /D OIS_DYNAMIC_LIB 83 /D ZLIB_WINAPI 84 /D LUA_BUILD_AS_DLL 85 /D _CRT_SECURE_NO_WARNINGS 86 /W3 87 /EHsc 88 /wd4522 89 /wd4251 90 /wd4800 91 ") 92 SET(CMAKE_C_FLAGS "${MSVC_CL_FLAGS}") 93 SET(CMAKE_CXX_FLAGS "${MSVC_CL_FLAGS}") 81 94 82 # Linker flags 83 SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}") 84 SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined") 85 SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined") 86 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined") 95 # Note: ${CMAKE_C_FLAGS} get added to the specific ones 96 SET(MSVC_CL_FLAGS_DEBUG "/MDd /Od /Zi /Gm /RTC1") 97 SET(MSVC_CL_FLAGS_RELEASE "/MD /MP2 /D TOLUA_RELEASE") 98 SET(CMAKE_C_FLAGS_DEBUG "${MSVC_CL_FLAGS_DEBUG}") 99 SET(CMAKE_CXX_FLAGS_DEBUG "${MSVC_CL_FLAGS_DEBUG}") 100 SET(CMAKE_C_FLAGS_RELEASE "${MSVC_CL_FLAGS_RELEASE} /O2") 101 SET(CMAKE_CXX_FLAGS_RELEASE "${MSVC_CL_FLAGS_RELEASE} /O2") 102 SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${MSVC_CL_FLAGS_RELEASE} /O2 /Zi") 103 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${MSVC_CL_FLAGS_RELEASE} /O2 /Zi") 104 SET(CMAKE_C_FLAGS_MINSIZEREL "${MSVC_CL_FLAGS_RELEASE} /O1") 105 SET(CMAKE_CXX_FLAGS_MINSIZEREL "${MSVC_CL_FLAGS_RELEASE} /O1") 106 107 ##################### Linker Flags ###################### 108 109 SET(MSVC_LINKER_FLAGS "") 110 SET(CMAKE_EXE_LINKER_FLAGS "${MSVC_LINKER_FLAGS}") 111 SET(CMAKE_SHARED_LINKER_FLAGS "${MSVC_LINKER_FLAGS}") 112 113 # Note: ${CMAKE_EXE_LINKER_FLAGS} get added to the specific ones 114 SET(MSVC_LINKER_FLAGS_DEBUG "/INCREMENTAL:YES") 115 SET(MSVC_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO /OPT:REF /OPT:ICF") 116 SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${MSVC_LINKER_FLAGS_DEBUG}") 117 SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${MSVC_LINKER_FLAGS_DEBUG}") 118 SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${MSVC_LINKER_FLAGS_RELEASE}") 119 SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${MSVC_LINKER_FLAGS_RELEASE}") 120 SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${MSVC_LINKER_FLAGS_RELEASE}") 121 SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${MSVC_LINKER_FLAGS_RELEASE}") 122 SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${MSVC_LINKER_FLAGS_RELEASE}") 123 SET(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${MSVC_LINKER_FLAGS_RELEASE}") 87 124 88 125 ######################### Misc ########################## -
code/branches/buildsystem2/cmake/ConfigPlatforms.cmake
r2585 r2588 70 70 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined") 71 71 72 # Also define macros to easily extend the compiler flags 73 # Additional argument is a condition 74 MACRO(ADD_CXX_FLAGS _flag _cond) 75 IF(${_cond}) 76 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}") 77 ENDIF(${_cond}) 78 ENDMACRO(ADD_CXX_FLAGS _flag) 79 MACRO(ADD_C_FLAGS _flag) 80 IF(${_cond}) 81 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}") 82 ENDIF(${_cond}) 83 ENDMACRO(ADD_C_FLAGS _flag) 84 72 85 ########## Plaform Specific Config ############## 73 86
Note: See TracChangeset
for help on using the changeset viewer.