diff mbox series

[meta-oe,3/5] libtinyxml2: Add ptest support

Message ID 20230406065421.767010-3-raj.khem@gmail.com
State New
Headers show
Series [meta-gnome,1/5] babl: Drop clang10 workaround for mips/rv64 | expand

Commit Message

Khem Raj April 6, 2023, 6:54 a.m. UTC
- Switch to usong meson build system
- Fix build with musl by defining _LARGEFILE64_SOURCE

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../recipes-support/libtinyxml2/files/run-ptest  | 10 ++++++++++
 .../libtinyxml2/libtinyxml2_9.0.0.bb             | 16 +++++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)
 create mode 100644 meta-oe/recipes-support/libtinyxml2/files/run-ptest
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/libtinyxml2/files/run-ptest b/meta-oe/recipes-support/libtinyxml2/files/run-ptest
new file mode 100644
index 0000000000..0797ea2374
--- /dev/null
+++ b/meta-oe/recipes-support/libtinyxml2/files/run-ptest
@@ -0,0 +1,10 @@ 
+#!/bin/sh
+
+for i in `ls *test`; do
+    $i
+    if [ $? -eq 0 ]; then
+        echo "PASS: $i"
+    else
+        echo "FAIL: $i"
+    fi
+done
diff --git a/meta-oe/recipes-support/libtinyxml2/libtinyxml2_9.0.0.bb b/meta-oe/recipes-support/libtinyxml2/libtinyxml2_9.0.0.bb
index 7f205987f4..b99a126ba2 100644
--- a/meta-oe/recipes-support/libtinyxml2/libtinyxml2_9.0.0.bb
+++ b/meta-oe/recipes-support/libtinyxml2/libtinyxml2_9.0.0.bb
@@ -4,14 +4,20 @@  SECTION = "libs"
 LICENSE = "Zlib"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=135624eef03e1f1101b9ba9ac9b5fffd"
 
-SRC_URI = "git://github.com/leethomason/tinyxml2.git;branch=master;protocol=https"
-
 SRCREV = "1dee28e51f9175a31955b9791c74c430fe13dc82"
+SRC_URI = "git://github.com/leethomason/tinyxml2.git;branch=master;protocol=https \
+           file://run-ptest"
 
 S = "${WORKDIR}/git"
 
-inherit cmake
+inherit meson ptest
 
-BBCLASSEXTEND = "native"
+EXTRA_OEMESON += "${@bb.utils.contains('PTEST_ENABLED', '1', '-Dtests=true', '', d)}"
+
+CXXFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE"
 
-EXTRA_OECMAKE += "-Dtinyxml2_SHARED_LIBS=YES"
+do_install_ptest() {
+    install -Dm 0755 ${B}/xmltest ${D}${PTEST_PATH}/xmltest
+}
+
+BBCLASSEXTEND = "native"