CMake/Windows: enable MSVC runtime DLL option for Clang (#1058)

User @supsm reported that using LLVM/clang to compile together with
the MSVC linker should support the MSVC runtime DLL selection.

This commit enables the option on Windows except MinGW and MSYS
rather than MSVC only.
This commit is contained in:
Albrecht Schlosser 2024-09-03 11:17:58 +02:00
parent 2afeb6d647
commit b595db30d4

View File

@ -85,16 +85,17 @@ set(FL_ABI_VERSION ${FLTK_ABI_VERSION})
# Note: this might be handled better by the 'MSVC_RUNTIME_LIBRARY'
# target property for each target rather than setting a global
# CMake variable - but this version does the latter.
# This also applies when using LLVM/clang on Windows (#1058).
#######################################################################
if(MSVC)
if(WIN32 AND NOT MINGW AND NOT MSYS)
option(FLTK_MSVC_RUNTIME_DLL "use MSVC Runtime-DLL (/MDx)" ON)
if(FLTK_MSVC_RUNTIME_DLL)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
endif(MSVC)
endif(WIN32 AND NOT MINGW AND NOT MSYS)
#######################################################################