summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-NEW.cmake2
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-OLD.cmake2
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-WARN.cmake2
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-common.cmake20
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/RunCMakeTest.cmake5
7 files changed, 37 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 4fe6ac1..f0a087e 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -352,6 +352,9 @@ if(MSVC)
add_RunCMake_test(MSVCRuntimeLibrary)
add_RunCMake_test(MSVCRuntimeTypeInfo)
add_RunCMake_test(MSVCWarningFlags)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ add_RunCMake_test(MSVCDebugInformationFormat)
+ endif()
endif()
if(XCODE_VERSION)
set(ObjectLibrary_ARGS -DXCODE_VERSION=${XCODE_VERSION})
diff --git a/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-NEW.cmake b/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-NEW.cmake
new file mode 100644
index 0000000..7dda266
--- /dev/null
+++ b/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0138 NEW)
+include(CMP0138-common.cmake)
diff --git a/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-OLD.cmake b/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-OLD.cmake
new file mode 100644
index 0000000..43e4668
--- /dev/null
+++ b/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0138 OLD)
+include(CMP0138-common.cmake)
diff --git a/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-WARN.cmake b/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-WARN.cmake
new file mode 100644
index 0000000..2a0dd0e
--- /dev/null
+++ b/Tests/RunCMake/MSVCDebugInformationFormat/CMP0138-WARN.cmake
@@ -0,0 +1,2 @@
+
+include(CMP0138-common.cmake)
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()
diff --git a/Tests/RunCMake/MSVCDebugInformationFormat/CMakeLists.txt b/Tests/RunCMake/MSVCDebugInformationFormat/CMakeLists.txt
new file mode 100644
index 0000000..5ff8d3e
--- /dev/null
+++ b/Tests/RunCMake/MSVCDebugInformationFormat/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.23)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/MSVCDebugInformationFormat/RunCMakeTest.cmake b/Tests/RunCMake/MSVCDebugInformationFormat/RunCMakeTest.cmake
new file mode 100644
index 0000000..7210fcd
--- /dev/null
+++ b/Tests/RunCMake/MSVCDebugInformationFormat/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0138-WARN)
+run_cmake(CMP0138-OLD)
+run_cmake(CMP0138-NEW)