cmake libssl.so 需要www.example.com,缺少并且没有已知的规则来创建它

qyzbxkaa  于 2023-02-12  发布在  其他
关注(0)|答案(1)|浏览(171)

我正在尝试为一个应用程序(www.example.com)编写一个Yocto菜谱application_1.0.0.bb,下面是该应用程序的一个(简化的)CMake:

cmake_minimum_required(VERSION 3.14)

project(
    server
    VERSION 0.1.0
    DESCRIPTION "Main application"
    HOMEPAGE_URL "https://gitlab.123.com/software/projects/server"
    LANGUAGES CXX
)

message(STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# ---- Poco::Util ----
find_package(Poco REQUIRED COMPONENTS Util)
find_package(unofficial-libmariadb CONFIG REQUIRED)
find_package(Poco REQUIRED COMPONENTS Data DataMySQL)

# ---- Declare executable ----
add_executable(server_exe 
  src/main.cpp
)
add_executable(server::exe ALIAS server_exe)
set_property(TARGET server_exe PROPERTY OUTPUT_NAME server)
target_compile_features(server_exe PRIVATE cxx_std_17)
target_link_libraries(server_exe
    PRIVATE
        Poco::Util
        Poco::DataMySQL
)

poco和mariadb都在www.example.com的DEPENDS中application.bb,它们的CMake过程的重要部分(在原始项目中打了一点补丁)是:

  • Poco::DataMySQL有target_link_libraries(DataMySQL PUBLIC Poco::Data ${MYSQL_LIBRARIES})set(MYSQL_LIBRARIES unofficial::libmariadb)和一个find_package(unofficial-libmariadb CONFIG REQUIRED),对了,Poco库是通过-DBUILD_SHARED_LIBS=OFF构建的(因此它构建静态库)
  • libmariadb有一个TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE ${SYSTEM_LIBS})SYSTEM_LIBSSET(SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})(OPENSSL_SSL_LIBRARY和OPENSSL_CRYPTO_LIBRARY都是从FIND_PACKAGE(OPENSSL)导出的变量)。它被导出为非官方的::libmariadb。

配置步骤是成功的,但在编译步骤开始时,bitbake给我这个错误:

ERROR: application-1.0+gitAUTOINC+ebcaa0785-r0 do_compile: ExecutionError('/home/buildbot/oe-core/build/cortexa53-tdx-linux/application/1.0+gitAUTOINC+ebcaa0785-r0/temp/run.do_compile.368082', 1, None, None)
ERROR: Logfile of failure stored in: ...
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: VERBOSE=1 cmake --build /home/buildbot/oe-core/build/tmp/work/cortexa53-tdx-linux/application/1.0+gitAUTOINC+ebcaa0785-r0/build --target all --
| ninja: error: '/home/buildbot/oe-core/build/tmp/work/cortexa53-tdx-linux/mariadb/10.7.4-r0/recipe-sysroot/usr/lib/libssl.so' needed by 'application', missing and no known rule to make it
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/.../application_1.0.0.bb:do_compile) failed with exit code '1'
sgtfey8w

sgtfey8w1#

该错误显示需要libssl.so,但缺少该网站。您需要在.bbappend文件中添加构建依赖项(可能还有运行时依赖项?)

DEPENDS += "openssl"
RDEPENDS += "openssl"

相关问题