新建一个XCODE静态库工程
从unity安装目录中找到il2cpp源码
Editor\Data\il2cpp\
改名 il2cpp/libil2cpp -> il2cpp/il2cpp
加入工程中
->工程根目录
extends/zlib
libil2cpp/
buildSettings 相关设置
IOS Deployment Target
ios 12.0
Header Search Paths
$(inherited)
$(SRCROOT)
$(SRCROOT)/external/zlib
$(SRCROOT)/external/baselib/Include
$(SRCROOT)/external/baselib/Platforms/IOS/Include
$(SRCROOT)/external/bdwgc/include
$(SRCROOT)/il2cpp/os/ClassLibraryPAL/brotli/include
$(SRCROOT)/libmono
$(SRCROOT)/il2cpp
CLanguage Dialect
gun11
C++Language Dialect
GUN++14
C++ Standard Libaray
libc++ (LLVM C++ starndad...)
预编译宏被卡了好久(最后参考了hybridclr的CMakeLists.txt)
Preprocessor Marcos
IL2CPP_TARGET_IOS=1 根据平台自选
BASELIB_DYNAMICLIBRARY=1
BASELIB_INLINE_NAMESPACE=il2cpp_baselib
IL2CPP_SUPPORT_THREADS
IL2CPP_THREADS_PTHREAD
IL2CPP_PLATFORM_SUPPORTS_TIMEZONEINFO
宏配置开关定义在il2cpp-config.h中 可以根据需求修改
User-Defined
LANG_CXX_LIBRARY = libc++
ENABLE_BITCODE = NO
VALIDATE_WORKSPACE = YES