[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/libunwind/trunk@362057 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 2c27ecf..07a95ce 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -1,3 +1,4 @@
+include(CMakePushCheckState)
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 include(CheckLibraryExists)
@@ -57,10 +58,13 @@
 
 # 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; }
 " LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
+  cmake_pop_check_state()
 endif()
 
 # Check compiler flags