在AOSP中支持Boost

Boost中包含许多库,可以按照需要编写Android.bp,下面以libboost_filesystem.so 为例:
版本:1.72.0 源码下载
参考对应boost源码中的CMakeList.txt

boost_1_72_0/libs/filesystem/CMakeLists.txt

add_library( boost_filesystem
    src/codecvt_error_category.cpp
    src/exception.cpp
    src/operations.cpp
    src/directory.cpp
    src/path.cpp
    src/path_traits.cpp
    src/portability.cpp
    src/unique_path.cpp
    src/utf8_codecvt_facet.cpp
    src/windows_file_codecvt.cpp
)
cc_library_shared {
    name: "libboost_filesystem",
    srcs: [
        "libs/filesystem/src/codecvt_error_category.cpp",
        "libs/filesystem/src/exception.cpp",
        "libs/filesystem/src/operations.cpp",
        "libs/filesystem/src/directory.cpp",
        "libs/filesystem/src/path.cpp",
        "libs/filesystem/src/path_traits.cpp",
        "libs/filesystem/src/portability.cpp",
        "libs/filesystem/src/unique_path.cpp",
        "libs/filesystem/src/utf8_codecvt_facet.cpp",
    ],
    rtti: true,
    cflags: [
        "-fPIC",
        "-fexceptions",
        "-Wno-error=non-virtual-dtor",
    ],
    export_include_dirs: ["."],
    vendor: true,
}

其中windows_file_codecvt.cpp是用于windows系统的,可以不加。

其余库对应Android.bp文件内容见GitHub
,慢慢更新所有的库。

你可能感兴趣的:(在AOSP中支持Boost)