diff options
author | Andrew Stitcher <astitcher@apache.org> | 2009-11-18 06:11:39 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2009-11-18 06:11:39 +0000 |
commit | a00757a2d7b82f098a31270ad1c59dce6767f64b (patch) | |
tree | 4a85ec76f3ae65867c813af762c6bc706e39e63a /cpp/src | |
parent | 520f9d2bd95379fbbcc83e8812bfaa531387f937 (diff) | |
download | qpid-python-a00757a2d7b82f098a31270ad1c59dce6767f64b.tar.gz |
Add compile options for SunPro compiler and rearrange setting warnings for GCC
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@881677 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/CMakeLists.txt | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index e0d47b893b..c524550b23 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -124,8 +124,8 @@ if (ENABLE_VALGRIND AND NOT VALGRIND) message(STATUS "Can't locate the valgrind command; no run-time error detection") endif (ENABLE_VALGRIND AND NOT VALGRIND) -option(ENABLE_WARNINGS "Enable lots of compiler warnings (recommended)" ON) -if (ENABLE_WARNINGS AND CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_COMPILER_IS_GNUCXX) + set (COMPILER_FLAGS "") # Warnings: Enable as many as possible, keep the code clean. Please # do not disable warnings or remove -Werror without discussing on # qpid-dev list. @@ -134,9 +134,20 @@ if (ENABLE_WARNINGS AND CMAKE_COMPILER_IS_GNUCXX) # -Wunreachable-code -Wpadded -Winline # -Wshadow - warns about boost headers. set (WARNING_FLAGS - " -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -Woverloaded-virtual") - set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}${WARNING_FLAGS}) -endif (ENABLE_WARNINGS AND CMAKE_COMPILER_IS_GNUCXX) + "-Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -Woverloaded-virtual") +endif (CMAKE_COMPILER_IS_GNUCXX) + +if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) + set (COMPILER_FLAGS "-library=stlport4 -mt") + set (WARNING_FLAGS "+w2") +endif (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) + +option(ENABLE_WARNINGS "Enable lots of compiler warnings (recommended)" ON) +if (NOT ENABLE_WARNINGS) + set (WARNING_FLAGS "") +endif (NOT ENABLE_WARNINGS) + +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS} ${WARNING_FLAGS}") # Expand a bit from the basic Find_Boost; be specific about what's needed. # TODO: Not all these libs are needed everywhere: |