summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-common.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-common.cmake')
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-common.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-common.cmake b/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-common.cmake
new file mode 100644
index 0000000..89a5ca1
--- /dev/null
+++ b/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-common.cmake
@@ -0,0 +1,20 @@
+foreach(lang C CXX)
+ enable_language(${lang})
+
+ cmake_policy(GET CMP0138 cmp0138)
+ if(cmp0138 STREQUAL "NEW")
+ if(NOT " ${CMAKE_${lang}_FLAGS_DEBUG} " MATCHES " -ZI ")
+ message(SEND_ERROR "CMAKE_${lang}_FLAGS_DEBUG does not have '-ZI' under NEW behavior")
+ endif()
+ if(NOT " ${CMAKE_${lang}_FLAGS_RELWITHDEBINFO} " MATCHES " -ZI ")
+ message(SEND_ERROR "CMAKE_${lang}_FLAGS_RELWITHDEBINFO does not have '-ZI' under NEW behavior")
+ endif()
+ else()
+ if(NOT " ${CMAKE_${lang}_FLAGS_DEBUG} " MATCHES " /Zi ")
+ message(SEND_ERROR "CMAKE_${lang}_FLAGS_DEBUG does not have '/Zi' under OLD behavior")
+ endif()
+ if(NOT " ${CMAKE_${lang}_FLAGS_RELWITHDEBINFO} " MATCHES " /Zi ")
+ message(SEND_ERROR "CMAKE_${lang}_FLAGS_RELWITHDEBINFO does not have '/Zi' under OLD behavior")
+ endif()
+ endif()
+endforeach()