xlua 下載包中提供lua5.3的庫文件,若是須要luajit或者本身添加刪除的就須要本身進行編譯。 Lua53版本沒那麼多事,主要是LuaJIt版本折騰的比較久。html
稍稍有點蛋疼,嘗試過在WIndow下使用Cygwin64進行編譯,不過一直提示「不可識別二進制數據「 ,解決不了就直接轉Mac平臺了。linux
Mac 平臺下編譯Android LuaJit 版本 連接庫注意:android
NDKP=$NDKVER/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-
ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM)) HOST_SYS= Windows HOST_RM= del else HOST_SYS:= $(shell uname -s) ifneq (,$(findstring MINGW,$(HOST_SYS))) HOST_SYS= Windows HOST_MSYS= mingw endif ifneq (,$(findstring CYGWIN,$(HOST_SYS))) HOST_SYS= Windows HOST_MSYS= cygwin endif # Use Clang for OSX host. 直接採用默認gcc #ifeq (Darwin,$(HOST_SYS)) # DEFAULT_CC= clang #endif endif
Make Error: The current CMakeCache.txt directory /Users/rubbyzhang/Perforce/rubbyzhang_RUBBYZHANG-MC0_7887/Redfox/Branches/OnlineBattle_xlua/ThirdParty/xLua-master/build/build_lj_x86/CMakeCache.txt is different than the directory c:/Users/rubbyzhang/Desktop/Lua/xLua-master/build/build_lj_x86 where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
Mac平臺下,xcode安裝好,基本就沒啥問題了ios
能夠參考xlua文檔 <增長刪除第三方庫> , 修改Cmakelists.txt文件以及C#部分,以增長lpeg、struct爲例,能夠在cmakelist.txt中增長設置:git
# 增長Lpeg set (LPEG_SRC pb/source/lpeg.c pb/source/struct.c) set_property( SOURCE ${LPEG_SRC} APPEND PROPERTY COMPILE_DEFINITIONS LUA_LIB ) list(APPEND THIRDPART_INC pb/include) set (THIRDPART_SRC ${THIRDPART_SRC} ${LPEG_SRC})
修改好的下載連接:http://pan.baidu.com/s/1sl12IFNgithub
參考:
mac平臺下LuaJIT-2.1.0-beta2 編譯android i686-linux-android-clang: Command not found
WIndows 使用VS編譯 Lua5
如何編譯各平臺使用的庫-以編譯tolua爲例
msvc交叉編譯:使用vcvarsall.bat設置命令行編譯環境shell