# Preprocessor
ADD_DEFINITIONS(/DUTILITIES_OS=${UTIL_TGT_OS_WINDOWS})
ADD_DEFINITIONS(/DUTILITIES_COMPILER=${UTIL_TGT_COMP_MSVC})
ADD_DEFINITIONS(/D08_HAS_EXCEPTIONS=0)
#ADD_DEFINITIONS(/D_STATIC_CPPLIB)

IF(CMAKE_BUILD_TYPE MATCHES Debug)
    ADD_DEFINITIONS(/DO8_IS_DEBUG=1)
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
IF(CMAKE_BUILD_TYPE MATCHES Release)
    ADD_DEFINITIONS(/DO8_IS_DEBUG=0)
ENDIF(CMAKE_BUILD_TYPE MATCHES Release)

# Compiler
# Disable exceptions
IF(CMAKE_CXX_FLAGS MATCHES "/EHsc$")
    MESSAGE("Exception: disabled")
    STRING(REPLACE "/EHsc" "/EHs-c-" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF(CMAKE_CXX_FLAGS MATCHES "/EHsc$")

# Disable RTTI
IF(CMAKE_CXX_FLAGS MATCHES "/GR$")
    MESSAGE("RTTI: disabled")
    STRING(REPLACE "/GR" "/GR-" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF(CMAKE_CXX_FLAGS MATCHES "/GR$")
