summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-05-27 13:10:35 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-05-27 13:10:43 (GMT)
commit49e31d9c5562c1c0eea3e280b560b49a8711dc68 (patch)
tree64b47d8e5c71ed0d72b5c3ae0acd026e9b1c5801 /Tests
parent6a2ee6f97795c5ae11b1b5dca9b8a0d8f5f4f8d7 (diff)
parent5fcadc481e4b60e5dbbacb026b73631b69ca3746 (diff)
downloadCMake-49e31d9c5562c1c0eea3e280b560b49a8711dc68.zip
CMake-49e31d9c5562c1c0eea3e280b560b49a8711dc68.tar.gz
CMake-49e31d9c5562c1c0eea3e280b560b49a8711dc68.tar.bz2
Merge topic 'msvc-compilers-default-to-ZI'
5fcadc481e MSVC: Default to -ZI instead of /Zi for x86 and x64 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7295
Diffstat (limited to 'Tests')
-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 da91e64..6f90bf7 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)