我在构建自己的包“grpcSandbox”时遇到了一些问题,它依赖于 gRPC 和 protobuf。已经存在构建良好的 gRPC 和 protobuf 配方。
问题是:grpcSandbox的cmake项目需要gRPC header/libs和protobuf header/libs + protobuf-compiler(protoc)目录。
我真的不明白如何从我的 grpcSandbox 包链接到来自 gRPC 的共享库,以及如何执行 protobuf 提供的元编译器“protoc”。
我所做的只是将依赖项添加到我的配方中的两个包中。
# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
# your responsibility to verify that the values are complete and correct.
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=79bfc140d04e521d1032e65eef60cfa8"
SRC_URI = "***"
# Modify these as desired
PV = "1.1+git${SRCPV}"
SRCREV = "***"
S = "${WORKDIR}/git"
# This depends on gRPC and protobuf (gRPC depends on protobuf)
RDEPENDS_${PN} += " grpc protobuf nativesdk-protobuf"
#protobuf-native makes the protoc (protobuf compiler) at build time accessible (host version)
#Need to check if this works, since it will convert proto-files to cpp/hpp files
DEPENDS_${PN} += " protobuf protobuf-native grpc"
# NOTE: unable to map the following CMake package dependencies: Protobuf GRPC
inherit cmake
# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
# Pass the path of sysroot to the cmake compiler script. Required to find headers of protobuf/protoc
EXTRA_OECMAKE = "-DOE_SYSROOT:STRING=${STAGING_DIR_HOST}"
When I start a devshell with "bitbake -c devshell grpcsandbox", the command "protoc" is not available and I cannot find the gRPC libs/headers in the sysroot of package grpcsandbox (which I thought they should be there, since I listed them as dependency for grpcSandbox).
What am I doing wrong?