diff options
author | Douman <douman@gmx.se> | 2019-03-29 19:45:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-04-03 18:30:11 (GMT) |
commit | d48bf97fd3ec9c6cc818d32978122f019e35f638 (patch) | |
tree | fa600e7c6138f5994e4cfb1a4170f14e0e2f9362 /Modules | |
parent | 1177464dda0849644d78abb1802b46238fe3feb3 (diff) | |
download | CMake-d48bf97fd3ec9c6cc818d32978122f019e35f638.zip CMake-d48bf97fd3ec9c6cc818d32978122f019e35f638.tar.gz CMake-d48bf97fd3ec9c6cc818d32978122f019e35f638.tar.bz2 |
FindBoost: Consider boost suffixes suitable for clang-cl
When compiling with `clang-cl` we can use either the MSVC- or
Clang-built boost libraries.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindBoost.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
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") |