summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2024-09-03 11:17:58 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2024-09-03 11:17:58 +0200
commitb595db30d46f9ace877540c073a7a3e7e423aaa7 (patch)
treedb0fe6ea5522c241e83e2e1c336f54d7e3b4ece8
parent2afeb6d64736b397aad8db2f5c88d3d8577fea28 (diff)
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.
-rw-r--r--CMake/options.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/CMake/options.cmake b/CMake/options.cmake
index 45dba4cde..2f3b36337 100644
--- a/CMake/options.cmake
+++ b/CMake/options.cmake
@@ -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)
#######################################################################