[PATCH] D23030: [CMake] Don't trust compiler error code, also check for errors

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 13:18:59 PDT 2016


beanz added a subscriber: brad.king.

================
Comment at: cmake/Modules/BuiltinTests.cmake:1
@@ -1,1 +1,2 @@
+include(CMakeCheckCompilerFlagCommonPatterns)
 
----------------
rnk wrote:
> That was also my first thought, but the file has this comment:
> ```
> # Do NOT include this module directly into any of your code. It is meant as
> # a library for Check*CompilerFlag.cmake modules. It's content may change in
> # any way between releases.
> ```
> 
> Think we should do it anyway?
My gut is to include it anyway. The alternative is to mimic what it does. @brad.king might have thoughts. Despite saying that, the macro's structure hasn't really changed ever.

================
Comment at: cmake/Modules/BuiltinTests.cmake:44
@@ +43,3 @@
+  foreach(var ${_CheckCCompilerFlag_COMMON_PATTERNS})
+    if("${TEST_OUTPUT}" STREQUAL "FAIL_REGEX")
+      continue()
----------------
rnk wrote:
> I think you meant `if ("${var}" STREQUAL "FAIL_REGEX")`
Duh...


https://reviews.llvm.org/D23030





More information about the llvm-commits mailing list