From d48bf97fd3ec9c6cc818d32978122f019e35f638 Mon Sep 17 00:00:00 2001 From: Douman Date: Fri, 29 Mar 2019 22:45:47 +0300 Subject: FindBoost: Consider boost suffixes suitable for clang-cl When compiling with `clang-cl` we can use either the MSVC- or Clang-built boost libraries. --- Modules/FindBoost.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 6e7d3db..1231ff1 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -465,7 +465,7 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret) endif() elseif (GHSMULTI) set(_boost_COMPILER "-ghs") - elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") + elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC" OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") if(MSVC_TOOLSET_VERSION GREATER_EQUAL 141) set(_boost_COMPILER "-vc141;-vc140") elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80) @@ -477,6 +477,12 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret) else() # VS 6.0 Good luck! set(_boost_COMPILER "-vc6") # yes, this is correct endif() + + if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang") + string(REPLACE "." ";" VERSION_LIST "${CMAKE_CXX_COMPILER_VERSION}") + list(GET VERSION_LIST 0 CLANG_VERSION_MAJOR) + set(_boost_COMPILER "-clangw${CLANG_VERSION_MAJOR};${_boost_COMPILER}") + endif() elseif (BORLAND) set(_boost_COMPILER "-bcb") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") -- cgit v0.12