如何在安卓中执行多个CMakeLists.txt文件

How to execute more than CMakeLists.txt files in android

本文关键字:CMakeLists txt 文件 执行      更新时间:2023-10-16

我的项目中包含两个 c++ 库,每个库都有 CMakeLists.txt 文件。我应该在build.gradle文件中添加什么来执行它们?我尝试了以下方法,但它不起作用:

cmake {
    path "CMakeLists.txt"
    path "src/main/cpp/fluidsynth/android/CMakeLists.txt"
}

但是在包含第一个CMakeLists.txt文件的库后,我遇到了运行时错误。

add_subdirectory("src/main/cpp/fluidsynth/android/CMakeLists.txt")添加到第一个 CMakeList 中.txt并从build.gradle文件中删除第二个路径。