From b595db30d46f9ace877540c073a7a3e7e423aaa7 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 3 Sep 2024 11:17:58 +0200 Subject: [PATCH] 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. --- CMake/options.cmake | 5 +++-- 1 file 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$<$:Debug>DLL") else() set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() -endif(MSVC) +endif(WIN32 AND NOT MINGW AND NOT MSYS) #######################################################################