summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-30 13:38:23 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-30 13:38:23 (GMT)
commite1729238c902c757a7812a6f6d6128118ae34fbf (patch)
treecaa9f81d7a212f1c925cec09005760fdbd933292
parent6d434ee6ccc250bfc653281643d70a3d1f8938cc (diff)
downloadCMake-e1729238c902c757a7812a6f6d6128118ae34fbf.zip
CMake-e1729238c902c757a7812a6f6d6128118ae34fbf.tar.gz
CMake-e1729238c902c757a7812a6f6d6128118ae34fbf.tar.bz2
Add initial XL C compiler flags for safer builds
This commit adds some default initial C flags for the XL compiler. The most important is "-qhalt=e" which causes the compiler to error-out on non-severe error messages. This is necessary to get try-compiles to fail when bad arguments are passed to a function.
-rw-r--r--Modules/Compiler/XL-C.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake
index cc4c7eb..8f66557 100644
--- a/Modules/Compiler/XL-C.cmake
+++ b/Modules/Compiler/XL-C.cmake
@@ -1,5 +1,10 @@
SET(CMAKE_C_VERBOSE_FLAG "-V")
+# -qthreaded = Ensures that all optimizations will be thread-safe
+# -qalias=noansi = Turns off type-based aliasing completely (safer optimizer)
+# -qhalt=e = Halt on error messages (rather than just severe errors)
+SET(CMAKE_C_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e")
+
SET(CMAKE_C_FLAGS_DEBUG_INIT "-g")
SET(CMAKE_C_FLAGS_RELEASE_INIT "-O -DNDEBUG")
SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")