diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-09 15:15:53 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-09 15:19:57 +0100 |
commit | 85b184e235d878ae109a0d37a861c3178f6c97e4 (patch) | |
tree | b9e7f986f2026970dfefc36c12aec0692cb3edb7 /solenv | |
parent | 19d0950451f909086c3732ce29812c4cda513908 (diff) |
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
Diffstat (limited to 'solenv')
-rwxr-xr-x | solenv/bin/native-code.py | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 6a345d15a903..fc47a1775f10 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: |