浏览代码

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 年之前
父节点
当前提交
e1729238c9
共有 1 个文件被更改,包括 5 次插入0 次删除
  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")