diff options
author | Josh Blum <josh@joshknows.com> | 2010-06-25 19:54:08 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-06-25 19:54:08 -0700 |
commit | 0a57031a8a2eee5c490350484b32ac3ccb000b2f (patch) | |
tree | b3feee4a5f38879ce83e716087c8641e1cbd6b7b /host/CMakeLists.txt | |
parent | 51cb8da5837adacbc626ee20aa58264e1b4b7a78 (diff) | |
download | uhd-0a57031a8a2eee5c490350484b32ac3ccb000b2f.tar.gz uhd-0a57031a8a2eee5c490350484b32ac3ccb000b2f.tar.bz2 uhd-0a57031a8a2eee5c490350484b32ac3ccb000b2f.zip |
uhd: fix for windows warning, tweaks for msvc optimization flags
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r-- | host/CMakeLists.txt | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index a8b89d6c5..2979b4279 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -55,7 +55,7 @@ MACRO(UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG flag have) ENDIF(${have}) ENDMACRO(UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG) -IF(UNIX) +IF(CMAKE_COMPILER_IS_GNUCXX) UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-Wall HAVE_WALL) UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-Wextra HAVE_WEXTRA) UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-pedantic HAVE_PEDANTIC) @@ -63,14 +63,19 @@ IF(UNIX) #only export symbols that are declared to be part of the uhd api: UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN) UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-O3 HAVE_O3) #have some optimizations -ENDIF(UNIX) +ENDIF(CMAKE_COMPILER_IS_GNUCXX) -IF(WIN32) +IF(MSVC) + #Set the predefined cxx debug flags to have only the debug flags + #because the default flags disable optimization which we want to have. + #Setting CMAKE_BUILD_TYPE to "release" does not seem to fix this issue. + SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd") #FIXME better way to do this? ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp ADD_DEFINITIONS(-DNOMINMAX) #disables stupidity and enables std::min and std::max ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) #avoid warnings from boost::split ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc -ENDIF(WIN32) + ADD_DEFINITIONS(/arch:SSE2 /G7 /O2 /fp:fast) #optimization flags +ENDIF(MSVC) ######################################################################## # Setup Boost |