build: add support for AppleClang compiler
This commit is contained in:
1 parent
ba6c378897
commit
771a400007
5 files changed
+16
-7
No files matched your search
@@ -23,7 +23,7 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
function(check_libcxx_in_use variable)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
message(CHECK_START "Checking if libc++ is being used")
|
||||
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ target_include_directories(mp-units-core ${unitsAsSystem} INTERFACE
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
if(${projectPrefix}LIBCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14")
|
||||
find_package(range-v3 CONFIG REQUIRED)
|
||||
target_link_libraries(mp-units-core INTERFACE range-v3::range-v3)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
# SOFTWARE.
|
||||
|
||||
function(__check_libcxx_in_use variable)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
message(CHECK_START "Checking if libc++ is being used")
|
||||
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||
|
||||
@@ -43,7 +43,7 @@ find_dependency(fmt)
|
||||
find_dependency(gsl-lite)
|
||||
|
||||
# add range-v3 dependency only for clang + libc++
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
__check_libcxx_in_use(__units_libcxx)
|
||||
if(__units_libcxx AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14")
|
||||
find_dependency(range-v3)
|
||||
|
||||
Reference in new issue
Block a user