From e1729238c902c757a7812a6f6d6128118ae34fbf Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Sep 2009 09:38:23 -0400 Subject: [PATCH] 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. --- Modules/Compiler/XL-C.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake index cc4c7eb13..8f6655762 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")