summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/capnproto
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-devtools/capnproto')
-rw-r--r--meta-oe/recipes-devtools/capnproto/capnproto/0001-Export-binaries-only-for-native-build.patch53
-rw-r--r--meta-oe/recipes-devtools/capnproto/capnproto_1.0.2.bb7
2 files changed, 58 insertions, 2 deletions
diff --git a/meta-oe/recipes-devtools/capnproto/capnproto/0001-Export-binaries-only-for-native-build.patch b/meta-oe/recipes-devtools/capnproto/capnproto/0001-Export-binaries-only-for-native-build.patch
new file mode 100644
index 0000000000..7677d96b23
--- /dev/null
+++ b/meta-oe/recipes-devtools/capnproto/capnproto/0001-Export-binaries-only-for-native-build.patch
@@ -0,0 +1,53 @@
1From e654a7015f5e8f20bf7681681cc2b80082303007 Mon Sep 17 00:00:00 2001
2From: Gyorgy Sarvari <skandigraun@gmail.com>
3Date: Tue, 25 Feb 2025 13:43:42 +0100
4Subject: [PATCH] Export binaries only for native build
5
6By default, the cmake configuratione exports all generated files,
7so when using the generated cmake file with a find_package command,
8it verifies that these files actually exist.
9
10When using the cross-compiled version of capnproto, the generated
11binaries are not available in RECIPE_SYSROOT (since they can be
12used as RDEPENDS only, but not usable as DEPENDS), and due to
13this the compilation fails.
14
15To avoid this, check during the compilation of capnproto if it is
16being cross-compiled, or not. If is it cross-compiled, then only
17install the generated binary files in their final location, but
18don't export them. When not cross-compiling, do the same, but also
19export the files (which is the default behavior).
20
21Upstream-Status: Inappropriate [oe specific: see above message]
22
23Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
24---
25 c++/src/capnp/CMakeLists.txt | 15 ++++++++++++++-
26 1 file changed, 14 insertions(+), 1 deletion(-)
27
28diff --git a/c++/src/capnp/CMakeLists.txt b/c++/src/capnp/CMakeLists.txt
29index 9980fde6..8732db93 100644
30--- a/src/capnp/CMakeLists.txt
31+++ b/src/capnp/CMakeLists.txt
32@@ -210,7 +210,20 @@ if(NOT CAPNP_LITE)
33 target_link_libraries(capnpc_capnp capnp kj)
34 set_target_properties(capnpc_capnp PROPERTIES OUTPUT_NAME capnpc-capnp)
35
36- install(TARGETS capnp_tool capnpc_cpp capnpc_capnp ${INSTALL_TARGETS_DEFAULT_ARGS})
37+ if(NOT CMAKE_CROSSCOMPILING)
38+ install(TARGETS capnp_tool capnpc_cpp capnpc_capnp ${INSTALL_TARGETS_DEFAULT_ARGS})
39+ else()
40+ # INSTALL_TARGETS_CROSS_COMPILED_BINARY_ARGS is identical to INSTALL_TARGETS_DEFAULT_ARGS,
41+ # except that the installed files are not exported, so when the generated cmake file
42+ # is used by a find_package command, it won't try to find these files.
43+ set(INSTALL_TARGETS_CROSS_COMPILED_BINARY_ARGS
44+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
45+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
46+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
47+ )
48+
49+ install(TARGETS capnp_tool capnpc_cpp capnpc_capnp ${INSTALL_TARGETS_CROSS_COMPILED_BINARY_ARGS})
50+ endif()
51
52 if(WIN32)
53 # On Windows platforms symlinks are not guaranteed to support. Also different version of CMake handle create_symlink in a different way.
diff --git a/meta-oe/recipes-devtools/capnproto/capnproto_1.0.2.bb b/meta-oe/recipes-devtools/capnproto/capnproto_1.0.2.bb
index cb4aef5224..0ea243fd20 100644
--- a/meta-oe/recipes-devtools/capnproto/capnproto_1.0.2.bb
+++ b/meta-oe/recipes-devtools/capnproto/capnproto_1.0.2.bb
@@ -5,13 +5,16 @@ SECTION = "console/tools"
5LICENSE = "MIT" 5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://../LICENSE;md5=a05663ae6cca874123bf667a60dca8c9" 6LIC_FILES_CHKSUM = "file://../LICENSE;md5=a05663ae6cca874123bf667a60dca8c9"
7 7
8SRC_URI = "git://github.com/sandstorm-io/capnproto.git;branch=release-${PV};protocol=https" 8SRC_URI = "git://github.com/sandstorm-io/capnproto.git;branch=release-${PV};protocol=https \
9 file://0001-Export-binaries-only-for-native-build.patch"
9SRCREV = "1a0e12c0a3ba1f0dbbad45ddfef555166e0a14fc" 10SRCREV = "1a0e12c0a3ba1f0dbbad45ddfef555166e0a14fc"
10 11
11S = "${WORKDIR}/git/c++" 12S = "${UNPACKDIR}/${BP}/c++"
12 13
13inherit cmake 14inherit cmake
14 15
16CVE_PRODUCT = "capnproto capnp"
17
15CXXFLAGS:append:mips = " -latomic" 18CXXFLAGS:append:mips = " -latomic"
16CXXFLAGS:append:powerpc = " -latomic" 19CXXFLAGS:append:powerpc = " -latomic"
17CXXFLAGS:append:riscv32 = " -latomic" 20CXXFLAGS:append:riscv32 = " -latomic"