diff options
author | Brad King <brad.king@kitware.com> | 2023-12-05 01:04:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-12-05 01:30:46 (GMT) |
commit | ef49ed0fe1034b1452bea4965f637671e68c008d (patch) | |
tree | 4902543241453dd3895a0c12bdbabd9252f8ebba /Modules/Platform | |
parent | b9970be9bcadc8f7c45f7603ad6eb1c75620608a (diff) | |
download | CMake-ef49ed0fe1034b1452bea4965f637671e68c008d.zip CMake-ef49ed0fe1034b1452bea4965f637671e68c008d.tar.gz CMake-ef49ed0fe1034b1452bea4965f637671e68c008d.tar.bz2 |
LLVMFlang: Fix MSVC ABI debug information format options
In commit 26bf32cdc6 (LLVMFlang: Add support for targeting MSVC ABI on
Windows, 2023-09-28, v3.28.0-rc1~10^2) we incorrectly recorded `-g` as
supporting the `ProgramDatabase` format, but it is actually `Embedded`,
matching Clang.
In order to support easy integration with C and C++ projects that use
the `.pdb` debug formats, pretend LLVMFlang supports them and just don't
actually emit any debug information.
Issue: #24840
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Windows-LLVMFlang-Fortran.cmake | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Modules/Platform/Windows-LLVMFlang-Fortran.cmake b/Modules/Platform/Windows-LLVMFlang-Fortran.cmake index 3e22a6e..57e36c6 100644 --- a/Modules/Platform/Windows-LLVMFlang-Fortran.cmake +++ b/Modules/Platform/Windows-LLVMFlang-Fortran.cmake @@ -17,11 +17,13 @@ elseif("x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "") set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "") - # FIXME(LLVMFlang): It does not provide all debug information format flags or predefines. - # It should be given a flag to enable Embedded debug information like MSVC -Z7. - #set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded) # not supported by LLVMFlang - #set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue) # not supported by LLVMFlang - set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase "-g") + # LLVMFlang, like Clang, does not provide all debug information format flags. + # In order to provide easy integration with C and C++ projects that use the + # other debug information formats, pretend to support them, and just do not + # actually generate any debug information for Fortran. + set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded -g) + set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase "") # not supported by LLVMFlang + set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue "") # not supported by LLVMFlang set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") |