[libcxx-commits] [libcxx] r362057 - [runtimes] Use -Wunknown-pragmas for the pragma check

Petr Hosek via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 29 22:38:06 PDT 2019


Author: phosek
Date: Wed May 29 22:38:06 2019
New Revision: 362057

URL: http://llvm.org/viewvc/llvm-project?rev=362057&view=rev
Log:
[runtimes] Use -Wunknown-pragmas for the pragma check

This is a follow up to r362055, we need -Wunknown-pragmas otherwise
the check is going to succeed it the pragma isn't supported.

Modified:
    libcxx/trunk/cmake/config-ix.cmake

Modified: libcxx/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/config-ix.cmake?rev=362057&r1=362056&r2=362057&view=diff
==============================================================================
--- libcxx/trunk/cmake/config-ix.cmake (original)
+++ libcxx/trunk/cmake/config-ix.cmake Wed May 29 22:38:06 2019
@@ -1,3 +1,4 @@
+include(CMakePushCheckState)
 include(CheckLibraryExists)
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
@@ -62,10 +63,13 @@ endif ()
 
 # Check compiler pragmas
 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  cmake_push_check_state()
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unknown-pragmas")
   check_c_source_compiles("
 #pragma comment(lib, \"c\")
 int main() { return 0; }
 " LIBCXX_HAS_COMMENT_LIB_PRAGMA)
+  cmake_pop_check_state()
 endif()
 
 if(NOT WIN32 OR MINGW)




More information about the libcxx-commits mailing list