[Libreoffice-commits] core.git: solenv/bin
Miklos Vajna
vmiklos at collabora.co.uk
Tue Dec 9 06:20:58 PST 2014
solenv/bin/native-code.py | 40 ++++++++++++++++++++++------------------
1 file changed, 22 insertions(+), 18 deletions(-)
New commits:
commit 85b184e235d878ae109a0d37a861c3178f6c97e4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Dec 9 15:15:53 2014 +0100
solenv: generate the ifdefs in native-code.py in a more elegant fashion
Commit 369b84e847802d77e7469f4ed71400c20e23039f (We don't build
libxsec_xmlsec for Android currently, 2014-08-13) added
platform-dependent guards to have components only on Android or only not
on Android. Generalize that a bit more, so adding new Android-only
components is a single line of code change.
Change-Id: I54711ffcdf64c4ddd986e2f59129797462dcfe58
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 6a345d1..fc47a17 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -47,7 +47,7 @@ core_factory_list = [
("libutllo.a", "utl_component_getFactory"),
("libxmlsecurity.a", "xmlsecurity_component_getFactory"),
("libxolo.a", "xo_component_getFactory"),
- ("libxsec_xmlsec.a", "xsec_xmlsec_component_getFactory"),
+ ("libxsec_xmlsec.a", "xsec_xmlsec_component_getFactory", "#ifndef ANDROID"),
("libxstor.a", "xstor_component_getFactory"),
]
@@ -153,7 +153,7 @@ draw_constructor_list = [
]
writer_factory_list = [
- ("libsblo.a", "sb_component_getFactory"),
+ ("libsblo.a", "sb_component_getFactory", "#ifdef ANDROID"),
("libswdlo.a", "swd_component_getFactory"),
("libswlo.a", "sw_component_getFactory"),
("libwriterfilterlo.a", "writerfilter_component_getFactory"),
@@ -197,15 +197,16 @@ extern "C" {
if options.groups:
for factory_group in options.groups:
- for (factory_name,factory_function) in factory_map[factory_group]:
- if factory_function == 'sb_component_getFactory':
- print ('#ifdef ANDROID')
- if factory_function == 'xsec_xmlsec_component_getFactory':
- print ('#ifndef ANDROID')
+ for entry in factory_map[factory_group]:
+ factory_name = entry[0]
+ factory_function = entry[1]
+ factory_guard = None
+ if len(entry) > 2:
+ factory_guard = entry[2]
+ if factory_guard:
+ print (factory_guard)
print ('void * '+factory_function+'( const char* , void* , void* );')
- if factory_function == 'sb_component_getFactory':
- print ('#endif')
- if factory_function == 'xsec_xmlsec_component_getFactory':
+ if factory_guard:
print ('#endif')
print ('')
@@ -222,15 +223,16 @@ lo_get_factory_map(void)
if options.groups:
for factory_group in options.groups:
- for (factory_name,factory_function) in factory_map[factory_group]:
- if factory_function == 'sb_component_getFactory':
- print ('#ifdef ANDROID')
- if factory_function == 'xsec_xmlsec_component_getFactory':
- print ('#ifndef ANDROID')
+ for entry in factory_map[factory_group]:
+ factory_name = entry[0]
+ factory_function = entry[1]
+ factory_guard = None
+ if len(entry) > 2:
+ factory_guard = entry[2]
+ if factory_guard:
+ print (factory_guard)
print (' { "'+factory_name+'", '+factory_function+' },')
- if factory_function == 'sb_component_getFactory':
- print ('#endif')
- if factory_function == 'xsec_xmlsec_component_getFactory':
+ if factory_guard:
print ('#endif')
print ("""
@@ -278,3 +280,5 @@ print ("""
}
}""")
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
More information about the Libreoffice-commits
mailing list