diff options
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Windows-Clang.cmake | 15 | ||||
-rw-r--r-- | Modules/Platform/Windows-Flang-Fortran.cmake | 5 |
2 files changed, 20 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake index b317da6..728e0b9 100644 --- a/Modules/Platform/Windows-Clang.cmake +++ b/Modules/Platform/Windows-Clang.cmake @@ -99,6 +99,21 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" "or clang-cl as both C and C++ compilers.") endif() + if(NOT CMAKE_RC_COMPILER_INIT) + # Check if rc is already in the path + # This may happen in cases where the user is already in a visual studio environment when CMake is invoked + find_program(__RC_COMPILER_PATH NAMES rc) + + # Default to rc if it's available, otherwise fall back to llvm-rc + if(__RC_COMPILER_PATH) + set(CMAKE_RC_COMPILER_INIT rc) + else() + set(CMAKE_RC_COMPILER_INIT llvm-rc) + endif() + + unset(__RC_COMPILER_PATH CACHE) + endif() + if ( "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" OR "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" ) include(Platform/Windows-MSVC) diff --git a/Modules/Platform/Windows-Flang-Fortran.cmake b/Modules/Platform/Windows-Flang-Fortran.cmake index a4b1cf1..c4420f7 100644 --- a/Modules/Platform/Windows-Flang-Fortran.cmake +++ b/Modules/Platform/Windows-Flang-Fortran.cmake @@ -1,3 +1,8 @@ include(Platform/Windows-MSVC) __windows_compiler_msvc(Fortran) set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> ${_COMPILE_Fortran} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") + +set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded -Xclang --dependent-lib=libcmt) +set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -Xclang --dependent-lib=msvcrt) +set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -Xclang --dependent-lib=libcmtd) +set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -Xclang --dependent-lib=msvcrtd) |