diff options
author | sanine <sanine.not@pm.me> | 2023-03-11 15:58:20 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-03-11 15:58:20 -0600 |
commit | ebc50b387ab209c9f9a0d92e340ac293d5697274 (patch) | |
tree | ea8c8b3677a18c994d2b9d33dbef3461dcf18113 /libs/luajit-cmake/Makefile | |
parent | c2329b4c8258baa9429c77566c9def97d00e96d7 (diff) |
build & link with luajit instead of lua5.1
Diffstat (limited to 'libs/luajit-cmake/Makefile')
-rw-r--r-- | libs/luajit-cmake/Makefile | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libs/luajit-cmake/Makefile b/libs/luajit-cmake/Makefile new file mode 100644 index 0000000..93cf3d9 --- /dev/null +++ b/libs/luajit-cmake/Makefile @@ -0,0 +1,48 @@ +ifeq ($(MAKE),mingw32-make) +CMAKE_OPTIONS += -G"MinGW Makefiles" +endif + +ifeq (${LUAJIT_DIR}, ) +LUAJIT_DIR = $(shell pwd)/../LuaJIT +endif +CMAKE_OPTIONS += -DLUAJIT_DIR=${LUAJIT_DIR} + +IOS_ARCH ?= armv7 + +.PHONY : all build install clean + +# Basic +all: build + cmake --build build --config Release + +install: all + cmake --install build + +build: + cmake -H. -Bbuild ${CMAKE_OPTIONS} + +clean: + @cmake -E remove_directory build + +lua: + cmake -H. -Bbuild -DLUA_DIR=$(shell pwd)/../lua + cmake --build build --config Release + +# Advance +iOS: + cmake -H. -Bbuild ${CMAKE_OPTIONS} \ + -DCMAKE_TOOLCHAIN_FILE=$(shell pwd)/Utils/ios.toolchain.cmake \ + -DIOS_PLATFORM=OS -DIOS_ARCH=$(IOS_ARCH) -DLUAJIT_DISABLE_JIT=1 \ + -DASM_FLAGS="-arch ${IOS_ARCH} -isysroot ${shell xcrun --sdk iphoneos --show-sdk-path}" + cmake --build build --config Release + +Android: + cmake -H. -Bbuild ${CMAKE_OPTIONS} \ + -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake + cmake --build build --config Release + +Windows: + cmake -H. -Bbuild ${CMAKE_OPTIONS} \ + -DCMAKE_TOOLCHAIN_FILE=${shell pwd}/Utils/windows.toolchain.cmake + cmake --build build --config Release + |