Skip to content

Commit

Permalink
build: macos: Set up -isysroot on macOS
Browse files Browse the repository at this point in the history
This is because, since Mojave (10.14), macOS SDK does not put headers in
/usr/include.
Thus, we need to tell where is sysroot that includes headers and
libraries.

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Jun 12, 2021
1 parent fecc158 commit 363d88c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,10 @@ endif()
# =========================================
if(FLB_BACKTRACE)
FLB_DEFINITION(FLB_HAVE_LIBBACKTRACE)
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
# From macOS Mojave, /usr/include does not store C SDK headers.
set(CFLAGS "${CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}")
endif()
ExternalProject_Add(backtrace
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/libbacktrace-ca0de05/
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/libbacktrace-ca0de05/configure ${AUTOCONF_HOST_OPT} --host=${HOST} --prefix=<INSTALL_DIR> --enable-shared=no --enable-static=yes
Expand Down

0 comments on commit 363d88c

Please sign in to comment.