Ver código fonte

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.
Brad King 16 anos atrás
pai
commit
e1729238c9
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      Modules/Compiler/XL-C.cmake

+ 5 - 0
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")