【问题标题】:Using shared library with Conan.io within Android在 Android 中与 Conan.io 一起使用共享库
【发布时间】:2019-07-19 09:40:59
【问题描述】:

我有一个预构建的共享库(架构 ARM),我将其导出为柯南包:

conan export-pkg .. ext/stable --force -pr android_19_arm_clang

接下来我想在我的 Android 项目中使用这个库。我有这样的柯南和 CMake 设置。

conanfile.txt:

[requires]
LibraryName/0.1@ext/stable

CMakeLists.txt

...
conan_basic_setup(NO_OUTPUT_DIRS)
...
target_link_libraries( # Specifies the target library.
                  myOwnAndroidLib-lib
                  android
                  ${CONAN_LIBS}
                  )
...

由于预建库是“.so”库,我必须将其放入我的 Android 项目的 jniLibs 文件夹中。 conan/Android 文档中缺少这部分。如何使用 conan 将 *.so 文件放在 jniLibs 文件夹中?

谢谢

【问题讨论】:

    标签: android conan


    【解决方案1】:

    如果您想在构建时将预构建的包复制到特定文件夹,则应使用功能imports

    https://docs.conan.io/en/latest/using_packages/conanfile_txt.html#imports

    https://docs.conan.io/en/latest/reference/conanfile_txt.html#imports

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-22
      • 2023-03-21
      • 2019-01-21
      • 1970-01-01
      • 2013-06-26
      • 2015-09-30
      • 2013-10-25
      • 1970-01-01
      相关资源
      最近更新 更多