build: luajit: macos: Handle macOS Monterey
@@ -14,7 +14,7 @@ set(LUAJIT_DEST ${CMAKE_CURRENT_BINARY_DIR})
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CFLAGS "${CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT} -fno-stack-check")
if (CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20
- AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 21)
+ AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 22)
set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=11.0")
else()
set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=10.15")
@@ -30,7 +30,7 @@ ExternalProject_Add(luajit
EXCLUDE_FROM_ALL TRUE
SOURCE_DIR ${LUAJIT_SRC}
CONFIGURE_COMMAND ./configure
- BUILD_COMMAND $(MAKE) CC=${CMAKE_C_COMPILER} CFLAGS=${CFLAGS} BUILD_MODE=static "XCFLAGS=-fPIC"
+ BUILD_COMMAND $(MAKE) CC=${CMAKE_C_COMPILER} ${DEPLOYMENT_TARGET} CFLAGS=${CFLAGS} BUILD_MODE=static "XCFLAGS=-fPIC"
INSTALL_COMMAND cp src/libluajit.a "${LUAJIT_DEST}/lib/libluajit.a")
# luajit (Windows)
