meson.bbclass: Specify a cross binary for cmake
PATCH 1/1 meson.bbclass: Specify a cross binary for cmake
This is needed to find dependencies that only provide CMake files, e.g., json-schema-validator in meta-oe.
--- meta/classes-recipe/meson.bbclass | 1 + 1 file changed, 1 insertion(+)
meta/classes-recipe/meson.bbclass +1 -0
@@ -73,6 +73,7 @@ nm = ${@meson_array('NM', d)} strip = ${@meson_array('STRIP', d)} readelf = ${@meson_array('READELF', d)} objcopy = ${@meson_array('OBJCOPY', d)} +cmake = 'cmake' pkg-config = 'pkg-config' llvm-config = 'llvm-config' cups-config = 'cups-config'
Quoted 1 line · Peter Kjellerstedt via lists.openembedded.org
+cmake = ‘cmake'
Is that not the default?
Ross
Quoted 11 lines
-----Original Message-----
From: Ross Burton <[email protected]>
Sent: den 4 februari 2025 17:20
To: Peter Kjellerstedt <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core] [PATCH] meson.bbclass: Specify a cross binary for cmakeQuoted 1 line · Peter Kjellerstedt via lists.openembedded.org
+cmake = ‘cmake'
Is that not the default?
Does not look like it. I guess it is the same as for, e.g., pkg-config, which is on the next line in the meson.cross file.
Without it, the build fails with:
Found CMake: NO
Run-time dependency nlohmann_json_schema_validator found: NO (tried pkgconfig)
../git/meson.build:8:18: ERROR: Dependency "nlohmann_json_schema_validator" not found, tried pkgconfig
With it, I instead get:
Found CMake: .../recipe-sysroot-native/usr/bin/cmake (3.30.2) Run-time dependency nlohmann_json_schema_validator found: YES 2.2.0
and the build succeeds.
Quoted 2 lines
Ross
//Peter
Quoted 2 lines · Peter Kjellerstedt
Does not look like it. I guess it is the same as for, e.g., pkg-config, which is on the next line in the meson.cross file.
Just had it confirmed that in cross builds meson needs _every_ binary to be specified, so this patch is entirely correct. Surprised we’d gone so long without the cmake integration to be honest.
Ross
Dear Peter,
I have a dependency that only provided CMake config files, which could not be found by meson, so I thought I'd try your patch. I don't know if it actually fixes the problem because before I could get to testing it, it leads to a strange error in the compilation of libpciaccess, where somehow /usr/include is in the includes leading to a compilation error.
ccache [...] -I/usr/include -fdiagnostics-color=always [...] src/libpciaccess.so.0.11.1.p/common_capability.c.o -MF src/libpciaccess.so.0.11.1.p/common_capability.c.o.d -o src/libpciaccess.so.0.11.1.p/comm on_capability.c.o -c ../libpciaccess-0.18.1/src/common_capability.c
cc1: warning: include location "/usr/include" is unsafe for cross-compilation [-Wpoison-system-directories]
This then presumably leading to:
In file included from ../libpciaccess-0.18.1/src/common_capability.c:39:/usr/include/stdio.h:205:27: error: 'L_tmpnam' undeclared here (not in a function)
I'll continue investigating.
Mit freundlichen Grüßen
STORZ Endoskop Produktions GmbH
i. A. Dr. Wolfgang Brehm
Softwareentwickler
Software Components & Multimedia
_____________________________________
Tel.: +41 (0)52 640 35 67 Mobil: +41 (0)76 361 57 07 E-Mail: [email protected]
www.karlstorz.com
Hausadresse:
STORZ Endoskop Produktions GmbH
Tuttlingen (D)
Zweigniederlassung Schaffhausen Schneckenackerstrasse 1
CH- 8200 Schaffhausen
===========================================================
STORZ Endoskop Produktions GmbH Dr.-Karl-Storz-Strasse 34
D-78532 Tuttlingen/Germany
Sitz der Gesellschaft/ Place of Business: Tuttlingen Handelsregister/ Commercial Register: Stuttgart HRB 451 142 USt.-ID-Nr./ VAT-ID-No.: DE 142931059 WEEE-Reg.-Nr./ WEEE Reg.-No.: DE 74465858
Geschäftsführer / Managing Director:
Karl-Christian Storz
===========================================================
Datenschutzmitteilung für Geschäftspartner / Business Partner Data Protection Notice<https://www.karlstorz.com/it/en/business-partner-data-protection.htm?target=business-partner-data-protection.htm>
________________________________
From: [email protected] <[email protected]> on behalf of Peter Kjellerstedt via lists.openembedded.org <[email protected]>
Sent: 04 February 2025 17:06
To: [email protected] <[email protected]>
Subject: [Ext] [OE-core] [PATCH] meson.bbclass: Specify a cross binary for cmake
This is needed to find dependencies that only provide CMake files, e. g. , json-schema-validator in meta-oe. Signed-off-by: Peter Kjellerstedt <peter. kjellerstedt@ axis. com> --- meta/classes-recipe/meson. bbclass | 1 + 1 file changed, 1 insertion(+)
This is needed to find dependencies that only provide CMake files, e.g., json-schema-validator in meta-oe.
--- meta/classes-recipe/meson.bbclass | 1 + 1 file changed, 1 insertion(+)
meta/classes-recipe/meson.bbclass +1 -0
@@ -73,6 +73,7 @@ nm = ${@meson_array('NM', d)} strip = ${@meson_array('STRIP', d)} readelf = ${@meson_array('READELF', d)} objcopy = ${@meson_array('OBJCOPY', d)} +cmake = 'cmake' pkg-config = 'pkg-config' llvm-config = 'llvm-config' cups-config = 'cups-config'