Home

Awesome

O-LLVM 9.0.1

适配 NDK-21.3.6528147(ndk-r21d)

编译命令

cd OLLVM-9.0.1
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_CREATE_XCODE_TOOLCHAIN=ON ../
make -j8 #8是你的CPU线程数量 比如8核16线程可以写 -j16 

整合到NDK

注意事项

Android Cmake 食用方式

android {
    ndkVersion = "21.3.6528147"
    defaultConfig {
        externalNativeBuild {
            cmake {
                cppFlags "-std=c++14", "-frtti", "-fexceptions", "-DANDROID_TOOLCHAIN=clang", "-ffunction-sections", "-fdata-sections",
                        "-mllvm", "-sub", "-mllvm", "-sub_loop=3",
                        "-mllvm", "-fla",
                        "-mllvm", "-split", "-mllvm", "-split_num=3",
                        "-mllvm", "-bcf", "-mllvm", "-bcf_loop=3", "-mllvm", "-bcf_prob=40",
                        "-mllvm", "-sobf", "-mllvm", "-aesSeed=0xada46ab5da824b96a18409c49dc91dc3"

                arguments "-DANDROID_TOOLCHAIN=clang",
                        "-DANDROID_STL=c++_shared",
                        "-DANDROID_CPP_FEATURES=rtti exceptions"
            }
            ndk {
                abiFilters 'armeabi-v7a', 'arm64-v8a', "x86", "x86_64"
            }
        }
    }
}

补充知识

更多玩法

补充说明