且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在CMakeLists.txt中添加新的源文件?

更新时间:2023-12-03 16:04:40

只需将cpp添加到您的CMakeLists

Just add the cpp to your CMakeLists

add_library( # Sets the name of the library.
        native-lib

        # Sets the library as a shared library.
        SHARED

        # Provides a relative path to your source file(s).
        src/main/cpp/native-lib.cpp
        src/main/cpp/utility.cpp
)