From 85cb56a87ebaaa339a10016931bca2ccbb5e5946 Mon Sep 17 00:00:00 2001 From: Chris Glover Date: Mon, 17 Jan 2022 22:19:44 +0000 Subject: [PATCH] Detect clangw toolset when using any clang with the ms-abi When compiling with clang, cmake only sets MSVC when using clang-cl as it's meant as an indication of cl.exe command line compatibility. In this case, if one is using clang++ with the ms-abi, cmake incorrectly takes the else branch here and library detection fails. If instead we use MSVC_VERSION, which is empty unless a compiler with _MSC_VER set is being used, then we get the correct behaviour. https://cmake.org/cmake/help/latest/variable/MSVC.html https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html --- BoostDetectToolset.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BoostDetectToolset.cmake b/BoostDetectToolset.cmake index c736157..ffe8158 100644 --- a/BoostDetectToolset.cmake +++ b/BoostDetectToolset.cmake @@ -28,7 +28,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - if(MSVC) + if(MSVC_VERSION) set(BOOST_DETECTED_TOOLSET "clangw") else() set(BOOST_DETECTED_TOOLSET "clang")