summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-03-10 00:16:53 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2020-03-10 00:16:53 +0200
commit01686a4e33f47f1f52685c40fa17d6a3361658a9 (patch)
tree6dcefb8584d47b18e85dec8450d578cf7c57818b
parent0f8eb205b41fd164280feb95eb3617ed55bfd6dd (diff)
Build cppuhelper idl with -C.
Change-Id: Ib50a3ba1b0c841fb881f18d783dbe13c880542a7
-rw-r--r--cppuhelper/meson.build1
-rwxr-xr-xcppuhelper/unotypes/cppuhbuilder.py40
-rw-r--r--cppuhelper/unotypes/meson.build3
3 files changed, 43 insertions, 1 deletions
diff --git a/cppuhelper/meson.build b/cppuhelper/meson.build
index e49c8b970415..8de475f9ae5a 100644
--- a/cppuhelper/meson.build
+++ b/cppuhelper/meson.build
@@ -70,6 +70,7 @@ test('cppumisc', unittester,
include_directories: [main_inc, udkh_inc],
cpp_args: ['-DLIBO_INTERNAL_ONLY'],
link_with: [cppu_lib, cppuhelper_lib, sal_lib],
+ install: true,
dependencies: [cppunit_dep],
)
]
diff --git a/cppuhelper/unotypes/cppuhbuilder.py b/cppuhelper/unotypes/cppuhbuilder.py
new file mode 100755
index 000000000000..eb0de9fa20f9
--- /dev/null
+++ b/cppuhelper/unotypes/cppuhbuilder.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python3
+
+from pathlib import Path
+import sys, os, subprocess
+
+# FIXME: mostly a duplicate of the same script in udkapi.
+# Make these use some sort of common functionality eventually.
+
+# command: [offbuilder,
+# cppumaker_exe,
+# offapi_urbm,
+# udkapi_urb,
+# '@OUTDIR@',
+# '@PRIVATE_DIR@',
+# meson.current_source_dir()]
+
+cppumaker = sys.argv[1]
+offapi_urb = sys.argv[2]
+offapi_urb_abs = os.path.join(os.getcwd(), offapi_urb)
+udkapi_urb = sys.argv[3]
+udkapi_urb_abs = os.path.join(os.getcwd(), udkapi_urb)
+out_dir = sys.argv[4]
+out_dir_abs = os.path.join(os.getcwd(), out_dir)
+private_dir = sys.argv[5]
+private_dir_abs = os.path.join(os.getcwd(), private_dir)
+fakeout = sys.argv[6]
+source_dir = sys.argv[7]
+
+if not os.path.exists(private_dir):
+ os.mkdir(private_dir)
+
+subprocess.check_call([cppumaker,
+ '-Gc',
+ '-C',
+ '-O' + out_dir_abs, # FIXME, should be priv_dir_abs
+ offapi_urb_abs,
+ '-X',
+ udkapi_urb_abs])
+
+open(fakeout, 'w')
diff --git a/cppuhelper/unotypes/meson.build b/cppuhelper/unotypes/meson.build
index c1101dd09f2f..11ad7885ed49 100644
--- a/cppuhelper/unotypes/meson.build
+++ b/cppuhelper/unotypes/meson.build
@@ -1,4 +1,5 @@
cppuhelperc = find_program('cppuhelperurb.py')
+cppuhbuilder = find_program('cppuhbuilder.py')
cppuhelper_rdb = custom_target('cppuhelper_urb',
output: 'cpphelper.rdb',
@@ -12,7 +13,7 @@ cppuhelper_rdb = custom_target('cppuhelper_urb',
cppuhelper_fake_h = custom_target('cpphelper_h',
output: 'cpphelper_fake.h',
- command: [offbuilder,
+ command: [cppuhbuilder,
cppumaker_exe,
cppuhelper_rdb,
udkapi_rdb,