Skip to contentSkip to conversation

protobuf: disable protoc binary for target

PATCH New Vyacheslav Yurkov 1 participant 1 message Aug 27, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 protobuf: disable protoc binary for target

From: Vyacheslav Yurkov <[email protected]>

When applications want to use protoc during the build, the target binary has to be disabled in order to avoid following error:

|   The imported target "protobuf::protoc" references the file
|
|      "<application build dir>/recipe-sysroot/usr/bin/protoc-<protobuf version>"
|
|   but this file does not exist.  Possible reasons include:
|
|   * The file was deleted, renamed, or moved to another location.
|
|   * An install or uninstall procedure did not complete successfully.
|
|   * The installation package was faulty and contained
|
|      "<application build dir>/recipe-sysroot/usr/lib/cmake/protobuf/protobuf-targets.cmake"
|
|   but not all the files it references.
---
 meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb +2 -0
index 83dabc9f8..0d8648e2f 100644
@@ -25,7 +25,9 @@ S = "${WORKDIR}/git"
 inherit cmake pkgconfig ptest
 
 PACKAGECONFIG ??= ""
+PACKAGECONFIG:class-native ?= "compiler"
 PACKAGECONFIG[python] = ",,"
+PACKAGECONFIG[compiler] = "-Dprotobuf_BUILD_PROTOC_BINARIES=ON,-Dprotobuf_BUILD_PROTOC_BINARIES=OFF"
 
 EXTRA_OECMAKE += "\
     -Dprotobuf_BUILD_SHARED_LIBS=ON \
Signature · 1 line
2.25.1