summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-28 23:36:56 (GMT)
committerBrad King <brad.king@kitware.com>2023-10-03 13:15:24 (GMT)
commit26bf32cdc67271547ca0b0d38872f8f23a90d191 (patch)
treecb7fff6bad7898d9ae422078394893d35136db25 /Tests
parente9af7b968756e72553296ecdcde6f36606a0babf (diff)
downloadCMake-26bf32cdc67271547ca0b0d38872f8f23a90d191.zip
CMake-26bf32cdc67271547ca0b0d38872f8f23a90d191.tar.gz
CMake-26bf32cdc67271547ca0b0d38872f8f23a90d191.tar.bz2
LLVMFlang: Add support for targeting MSVC ABI on Windows
The compiler does not yet support everything needed to integrate well with the MSVC ABI, in particular for runtime library selection and debug format selection. Document them in FIXME comments and leave this support undocumented by CMake for now. Fixes: #24840 Inspired-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt9
-rw-r--r--Tests/Fortran/CMakeLists.txt2
-rw-r--r--Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt7
3 files changed, 16 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 915c974..4c61eab 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -439,6 +439,10 @@ if(BUILD_TESTING)
set(CMAKE_SKIP_VSGNUFortran TRUE)
endif()
endif()
+ if(CMAKE_Fortran_COMPILER_ID STREQUAL LLVMFlang)
+ # No DLLEXPORT for 'Tests/VSGNUFortran/subdir/fortran/world.f'.
+ set(CMAKE_SKIP_VSGNUFortran TRUE)
+ endif()
if(CMAKE_Fortran_COMPILER_ID STREQUAL IntelLLVM)
message(STATUS "Skip VSGNUFortran for ifx until DLLEXPORT support is implemented")
set(CMAKE_SKIP_VSGNUFortran TRUE)
@@ -2150,7 +2154,10 @@ if(BUILD_TESTING)
endif()
set(MSVCDebugInformationFormat_BUILD_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
- if(CMAKE_Fortran_COMPILER)
+ if(CMAKE_Fortran_COMPILER
+ # FIXME(LLVMFlang): It does not provide debug information format flags or predefines.
+ AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang"
+ )
list(APPEND MSVCDebugInformationFormat_BUILD_OPTIONS -DCMake_TEST_Fortran=1)
endif()
ADD_TEST_MACRO(MSVCDebugInformationFormat)
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index 30ab16b..41d3b4e 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -29,7 +29,7 @@ endif()
# Pick a module .def file with the properly mangled symbol name.
set(world_def "")
if(WIN32 AND NOT CYGWIN)
- if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU|LCC")
+ if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU|LCC|LLVMFlang")
set(world_def world_gnu.def)
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel" OR
CMAKE_GENERATOR MATCHES "Visual Studio") # Intel plugin
diff --git a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
index 41bd6f5..2a8a152 100644
--- a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
@@ -21,6 +21,13 @@ foreach(t MultiThreaded SingleThreaded)
endforeach()
endforeach()
endforeach()
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
+ # LLVMFlang does not actually define these, so inject them
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "-D_MT")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "-D_MT;-D_DLL")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "-D_MT;-D_DEBUG")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "-D_MT;-D_DEBUG;-D_DLL")
+endif()
string(APPEND CMAKE_Fortran_FLAGS " -w")
function(verify_combinations threads lang src)