eventually MSVC does not like my /O2 flags (incompatibility with other option set by default)

This commit is contained in:
Gael Guennebaud 2009-02-06 15:29:40 +00:00
parent 19b035ee11
commit 1c24f5bbc5

View File

@ -83,8 +83,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g2")
endif(CMAKE_SYSTEM_NAME MATCHES Linux)
set(EI_OFLAG "-O2")
elseif(MSVC)
set(EI_OFLAG "/O2")
# MSVC fails with:
# cl : Command line warning D9025 : overriding '/Od' with '/O2'
# cl : Command line error D8016 : '/RTC1' and '/O2' command-line options are incompatible
# elseif(MSVC)
# set(EI_OFLAG "/O2")
else(CMAKE_COMPILER_IS_GNUCXX)
set(EI_OFLAG "")
endif(CMAKE_COMPILER_IS_GNUCXX)