Sfoglia il codice sorgente

[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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362057 91177308-0d34-0410-b5e6-96231b3b80d8
Petr Hosek 6 anni fa
parent
commit
bdc9a5aebf
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      cmake/config-ix.cmake

+ 4 - 0
cmake/config-ix.cmake

@@ -1,3 +1,4 @@
+include(CMakePushCheckState)
 include(CheckLibraryExists)
 include(CheckLibraryExists)
 include(CheckCCompilerFlag)
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 include(CheckCXXCompilerFlag)
@@ -62,10 +63,13 @@ endif ()
 
 
 # Check compiler pragmas
 # Check compiler pragmas
 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 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("
   check_c_source_compiles("
 #pragma comment(lib, \"c\")
 #pragma comment(lib, \"c\")
 int main() { return 0; }
 int main() { return 0; }
 " LIBCXX_HAS_COMMENT_LIB_PRAGMA)
 " LIBCXX_HAS_COMMENT_LIB_PRAGMA)
+  cmake_pop_check_state()
 endif()
 endif()
 
 
 if(NOT WIN32 OR MINGW)
 if(NOT WIN32 OR MINGW)