Better toolchain include discovery on macOS

This commit is contained in:
Jack Andersen 2018-01-03 13:52:01 -10:00
parent 87f213bc0b
commit ec49377fcd
2 changed files with 12 additions and 6 deletions

View File

@ -202,12 +202,15 @@ macro(atdna out)
# OSX Extra # OSX Extra
elseif(APPLE) elseif(APPLE)
get_filename_component(COMPILER_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY)
if (NOT EXISTS "${CMAKE_OSX_SYSROOT}") if (NOT EXISTS "${CMAKE_OSX_SYSROOT}")
message(FATAL_ERROR "CMAKE_OSX_SYSROOT not set") message(FATAL_ERROR "CMAKE_OSX_SYSROOT not set")
endif() endif()
list(APPEND extraargs -isysroot ${CMAKE_OSX_SYSROOT} -isysroot ${CMAKE_OSX_SYSROOT}/usr/include list(APPEND extraargs
-I ${CMAKE_OSX_SYSROOT}/../../../../../Toolchains/XcodeDefault.xctoolchain -isysroot ${CMAKE_OSX_SYSROOT}
-I ${CMAKE_OSX_SYSROOT}/../../../../../Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1) -isysroot ${CMAKE_OSX_SYSROOT}/usr/include
-I ${COMPILER_DIR}/../..
-I ${COMPILER_DIR}/../include/c++/v1)
endif() endif()
# Make target # Make target

View File

@ -52,12 +52,15 @@ macro(atdna out)
# OSX Extra # OSX Extra
elseif(APPLE) elseif(APPLE)
get_filename_component(COMPILER_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY)
if (NOT EXISTS "${CMAKE_OSX_SYSROOT}") if (NOT EXISTS "${CMAKE_OSX_SYSROOT}")
message(FATAL_ERROR "CMAKE_OSX_SYSROOT not set") message(FATAL_ERROR "CMAKE_OSX_SYSROOT not set")
endif() endif()
list(APPEND extraargs -isysroot ${CMAKE_OSX_SYSROOT} -isysroot ${CMAKE_OSX_SYSROOT}/usr/include list(APPEND extraargs
-I ${CMAKE_OSX_SYSROOT}/../../../../../Toolchains/XcodeDefault.xctoolchain -isysroot ${CMAKE_OSX_SYSROOT}
-I ${CMAKE_OSX_SYSROOT}/../../../../../Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1) -isysroot ${CMAKE_OSX_SYSROOT}/usr/include
-I ${COMPILER_DIR}/../..
-I ${COMPILER_DIR}/../include/c++/v1)
endif() endif()
# Make target # Make target