summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/gcc.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-11-14 15:44:12 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2003-11-14 15:44:12 (GMT)
commitc3530dd01f4e44af3e6218d51533f9d10ea3ae53 (patch)
treedc21f1ac5db3571a667d0d4a150c64c9facde3d0 /Modules/Platform/gcc.cmake
parenta293f8f7a0ee9d26b3a3ac50fe2f6555dc130a17 (diff)
downloadCMake-c3530dd01f4e44af3e6218d51533f9d10ea3ae53.zip
CMake-c3530dd01f4e44af3e6218d51533f9d10ea3ae53.tar.gz
CMake-c3530dd01f4e44af3e6218d51533f9d10ea3ae53.tar.bz2
BUG: fix for bug 383 gcc flags are now always set if the compiler is gnu
Diffstat (limited to 'Modules/Platform/gcc.cmake')
-rw-r--r--Modules/Platform/gcc.cmake26
1 files changed, 16 insertions, 10 deletions
diff --git a/Modules/Platform/gcc.cmake b/Modules/Platform/gcc.cmake
index 1058a42..9d289d1 100644
--- a/Modules/Platform/gcc.cmake
+++ b/Modules/Platform/gcc.cmake
@@ -1,10 +1,16 @@
-SET (CMAKE_CXX_FLAGS_INIT "")
-SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os")
-SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3")
-SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
-SET (CMAKE_C_FLAGS_INIT "")
-SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
-SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os")
-SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3")
-SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+IF(CMAKE_COMPILER_IS_GNUCC)
+ SET (CMAKE_C_FLAGS_INIT "")
+ SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
+ SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os")
+ SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3")
+ SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
+IF(CMAKE_COMPILER_IS_GNUCXX)
+ SET (CMAKE_CXX_FLAGS_INIT "")
+ SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+ SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os")
+ SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3")
+ SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+