Better Maintainer build type settings (for MSVC)
authorAlpar Juttner <alpar@cs.elte.hu>
Sun, 24 Feb 2013 19:44:14 +0100
changeset 1185b4f4c08e1210
parent 1184 97975184f4aa
child 1186 2e959a5a0c2d
child 1230 caf16813b1e8
Better Maintainer build type settings (for MSVC)
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Fri Feb 22 16:49:41 2013 +0100
     1.2 +++ b/CMakeLists.txt	Sun Feb 24 19:44:14 2013 +0100
     1.3 @@ -91,20 +91,38 @@
     1.4  
     1.5  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}")
     1.6  
     1.7 -SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING
     1.8 +IF(MSVC)
     1.9 +  SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
    1.10      "Flags used by the C++ compiler during maintainer builds."
    1.11 -    FORCE )
    1.12 -SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING
    1.13 +    )
    1.14 +  SET( CMAKE_C_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
    1.15      "Flags used by the C compiler during maintainer builds."
    1.16 -    FORCE )
    1.17 -SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
    1.18 +    )
    1.19 +  SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
    1.20 +    "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
    1.21 +    "Flags used for linking binaries during maintainer builds."
    1.22 +    )
    1.23 +  SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
    1.24 +    "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
    1.25 +    "Flags used by the shared libraries linker during maintainer builds."
    1.26 +    )
    1.27 +ELSE()
    1.28 +  SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING
    1.29 +    "Flags used by the C++ compiler during maintainer builds."
    1.30 +    )
    1.31 +  SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING
    1.32 +    "Flags used by the C compiler during maintainer builds."
    1.33 +    )
    1.34 +  SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
    1.35      "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
    1.36      "Flags used for linking binaries during maintainer builds."
    1.37 -    FORCE )
    1.38 -SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
    1.39 +    )
    1.40 +  SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
    1.41      "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
    1.42      "Flags used by the shared libraries linker during maintainer builds."
    1.43 -    FORCE )
    1.44 +    )
    1.45 +ENDIF()
    1.46 +
    1.47  MARK_AS_ADVANCED(
    1.48      CMAKE_CXX_FLAGS_MAINTAINER
    1.49      CMAKE_C_FLAGS_MAINTAINER