summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/MSVCWarningFlags/CMP0092-common.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/MSVCWarningFlags/CMP0092-common.cmake')
-rw-r--r--Tests/RunCMake/MSVCWarningFlags/CMP0092-common.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/MSVCWarningFlags/CMP0092-common.cmake b/Tests/RunCMake/MSVCWarningFlags/CMP0092-common.cmake
new file mode 100644
index 0000000..87d7f67
--- /dev/null
+++ b/Tests/RunCMake/MSVCWarningFlags/CMP0092-common.cmake
@@ -0,0 +1,12 @@
+enable_language(C)
+
+cmake_policy(GET CMP0092 cmp0092)
+if(cmp0092 STREQUAL "NEW")
+ if("${CMAKE_C_FLAGS}" MATCHES "([/-]W[0-9])")
+ message(SEND_ERROR "CMAKE_C_FLAGS has '${CMAKE_MATCH_1}' under NEW behavior")
+ endif()
+else()
+ if(NOT " ${CMAKE_C_FLAGS} " MATCHES " /W3 ")
+ message(SEND_ERROR "CMAKE_C_FLAGS does not have '/W3' under OLD behavior")
+ endif()
+endif()