Skip to contentSkip to conversation

protobuf: disable protoc binary for targe

PATCH Vyacheslav Yurkov 1 participant 1 message Aug 27, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

On master-next please

Thanks,
Vyacheslav

Quoted 53 lines · Vyacheslav Yurkov via lists.openembedded.org

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 | 7 +++++++
  1 file changed, 7 insertions(+)
meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb +7 -1
index 83dabc9f8..e36179363 100644
@@ -34,6 +34,13 @@ EXTRA_OECMAKE += "\
      -Dprotobuf_BUILD_EXAMPLES=OFF \
  "
 
+# Configuration below allows to cross-compile protobuf applications
+# and use native protoc binary in your recipes. In order to use protoc
+# on the target, set protobuf_BUILD_PROTOC_BINARIES to ON in your bbappend
+EXTRA_OECMAKE:append:class-target = " \
+     -Dprotobuf_BUILD_PROTOC_BINARIES=OFF \
+"
+
  TEST_SRC_DIR = "examples"
  LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#98484): https://lists.openembedded.org/g/openembedded-devel/message/98484
Mute This Topic: https://lists.openembedded.org/mt/93286108/4455192
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-