Merge branch 'fix-workaround' into 'master'

cmake: fix macos workaround for cmake 3.16

See merge request basalt/basalt!39
This commit is contained in:
Vladyslav Usenko 2019-12-26 22:40:49 +00:00
commit 2af4a6fa3d
1 changed files with 5 additions and 4 deletions

View File

@ -125,14 +125,15 @@ if(APPLE)
if(CMAKE_SYSTEM_VERSION VERSION_LESS 19.0.0) if(CMAKE_SYSTEM_VERSION VERSION_LESS 19.0.0)
# use brewed llvm's libc++ # use brewed llvm's libc++
# Note: the suffix "/../v1" for the include path is needed to work around a recent cmake issue: include_directories("/usr/local/opt/llvm/include/c++/v1")
# https://gitlab.kitware.com/cmake/cmake/issues/19251#note_571030
include_directories("/usr/local/opt/llvm/include/c++/v1/../v1")
link_directories("/usr/local/opt/llvm/lib") link_directories("/usr/local/opt/llvm/lib")
add_compile_options("-nostdinc++") add_compile_options("-nostdinc++")
set(STD_CXX_FS c++fs) set(STD_CXX_FS c++fs)
endif()
# Workaround for cmake not to filter the manually added standard include path
# See: https://gitlab.kitware.com/cmake/cmake/issues/19227#note_669894
list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/local/opt/llvm/include/c++/v1")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
message(STATUS "Detected macOS with non-Apple clang") message(STATUS "Detected macOS with non-Apple clang")