diff options
author | Brad King <brad.king@kitware.com> | 2023-12-06 13:50:08 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-12-06 13:50:17 (GMT) |
commit | 91392d77417ba8b1ad3148c6e2eea337b57edb36 (patch) | |
tree | d8c70d963068b4089e1894a3535ed0f92d2cdf2e /Tests | |
parent | 4e96c07b28f8ce37d99bdb6362e724ecde4c316d (diff) | |
parent | ef49ed0fe1034b1452bea4965f637671e68c008d (diff) | |
download | CMake-91392d77417ba8b1ad3148c6e2eea337b57edb36.zip CMake-91392d77417ba8b1ad3148c6e2eea337b57edb36.tar.gz CMake-91392d77417ba8b1ad3148c6e2eea337b57edb36.tar.bz2 |
Merge topic 'LLVMFlang-MSVC-debug' into release-3.28
ef49ed0fe1 LLVMFlang: Fix MSVC ABI debug information format options
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9037
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/MSVCDebugInformationFormat/override-Fortran.cmake | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 4c61eab..a1619ec 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2154,10 +2154,7 @@ if(BUILD_TESTING) endif() set(MSVCDebugInformationFormat_BUILD_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA}) - if(CMAKE_Fortran_COMPILER - # FIXME(LLVMFlang): It does not provide debug information format flags or predefines. - AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang" - ) + if(CMAKE_Fortran_COMPILER) list(APPEND MSVCDebugInformationFormat_BUILD_OPTIONS -DCMake_TEST_Fortran=1) endif() ADD_TEST_MACRO(MSVCDebugInformationFormat) diff --git a/Tests/MSVCDebugInformationFormat/override-Fortran.cmake b/Tests/MSVCDebugInformationFormat/override-Fortran.cmake index 5d2db58..8bc2067 100644 --- a/Tests/MSVCDebugInformationFormat/override-Fortran.cmake +++ b/Tests/MSVCDebugInformationFormat/override-Fortran.cmake @@ -2,3 +2,11 @@ set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded") string(REPLACE "-Z7" "-Z7;-DTEST_Z7" "${var}" "${${var}}") set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase") string(REPLACE "-Zi" "-Zi;-DTEST_Zi" "${var}" "${${var}}") + +if(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang") + set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded") + string(REPLACE "-g" "-g;-DTEST_Z7" "${var}" "${${var}}") + # LLVMFlang does not actually support these, but Windows-LLVMFlang-Fortran pretends it does. + set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase "-DTEST_Zi") + set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue "-DTEST_ZI") +endif() |