forked from LibreOffice/core
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build udkapi headers and use them in targets.
Change-Id: I277a036700d43799113194c23ec643ba6f6b56de
- Loading branch information
Showing
8 changed files
with
73 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from pathlib import Path | ||
import sys, os, subprocess | ||
|
||
# NOTE: cppumaker is _very_ picky about paths. For | ||
# example if you pass the output directory as relative | ||
# it will fail with a misleading error that has _nothing_ | ||
# to do with the actual problem. | ||
|
||
idlwrite = sys.argv[1] | ||
cppumaker = sys.argv[2] | ||
out_dir = sys.argv[3] | ||
out_dir_abs = os.path.join(os.getcwd(), sys.argv[3]) | ||
priv_dir = sys.argv[4] | ||
priv_dir_abs = os.path.join(os.getcwd(), sys.argv[4]) | ||
fakeout = sys.argv[5] | ||
source_dir = sys.argv[6] | ||
classnamefile = os.path.join(priv_dir, 'classnames') | ||
rdbfile = os.path.join(os.getcwd(), priv_dir, 'udkapi.rdb') | ||
|
||
if not os.path.exists(priv_dir): | ||
os.mkdir(priv_dir) | ||
|
||
with open(classnamefile, 'w') as of: | ||
fnames = Path(source_dir).glob('com/**/*.idl') | ||
for fname in fnames: | ||
dotname = str(fname.relative_to(source_dir).with_suffix('')).replace('/', '.') | ||
if dotname == 'com.sun.star.modules': | ||
continue | ||
of.write(dotname) | ||
of.write(' ') | ||
|
||
subprocess.check_call([idlwrite, | ||
source_dir, | ||
'@' + classnamefile, | ||
rdbfile]) | ||
|
||
subprocess.check_call([cppumaker, | ||
'-Gc', | ||
'-O' + out_dir_abs, # FIXME, should be priv_dir_abs | ||
rdbfile]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cnbuilder = find_program('classnamebuilder.py') | ||
|
||
# FIXME, this only generates headers. There is no | ||
# proper dependency tracking or dealing of the rdb file. | ||
udk_fake_h = custom_target('udkapi_h', | ||
output: 'udk_fake.h', | ||
command: [cnbuilder, | ||
unoidl_write_exe, | ||
cppumaker_exe, | ||
'@OUTDIR@', | ||
'@PRIVATE_DIR@', | ||
'@OUTPUT@', | ||
meson.current_source_dir()] | ||
) | ||
udkh_inc = include_directories('.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters