Skip to content

Commit 228f981

Browse files
committed
build: pass sysroot to MacOS SDK
There were issues with configuring LuaJIT on Apple machines, since <LuaJITTestArch> CMake auxiliary routine fails to locate system headers (e.g. assert.h in case when LUA_USE_ASSERT is enabled). As a result platform detection fails and LuaJIT configuration ends with the fatal error. This patch adds the necessary flags to help the routine to find the required system headers. Needed for tarantool/tarantool#6065 Relates to tarantool/tarantool#5629 Follows up tarantool/tarantool#4862 Reviewed-by: Sergey Kaplun <[email protected]> Reviewed-by: Sergey Ostanevich <[email protected]> Signed-off-by: Igor Munkin <[email protected]>
1 parent 789820a commit 228f981

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cmake/LuaJITUtils.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
function(LuaJITTestArch outvar strflags)
2+
# XXX: This routine uses external headers (e.g. system ones),
3+
# which location is specified either implicitly (within CMake
4+
# machinery) or explicitly (manually by configuration options).
5+
# Need -isysroot flag on recentish MacOS after command line
6+
# tools no longer provide headers in /usr/include.
7+
# XXX: According to CMake documentation[1], CMAKE_OSX_SYSROOT
8+
# variable *should* be ignored on the platforms other than
9+
# MacOS. It is ignored by CMake itself, but since this routine
10+
# extends CMake, it should also follow this policy.
11+
# [1]: https://cmake.org/cmake/help/v3.1/variable/CMAKE_OSX_SYSROOT.html
12+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT)
13+
set(strflags "${strflags} -isysroot ${CMAKE_OSX_SYSROOT}")
14+
endif()
215
# XXX: <execute_process> simply splits the COMMAND argument by
316
# spaces with no further parsing. At the same time GCC is bad in
417
# argument handling, so let's help it a bit.

0 commit comments

Comments
 (0)