diff options
author | jan Iversen <jani@libreoffice.org> | 2017-10-16 20:23:24 +0200 |
---|---|---|
committer | jan Iversen <jani@libreoffice.org> | 2017-10-16 20:26:00 +0200 |
commit | cd5a5c0baecac2832841208034b42724fcfbb49d (patch) | |
tree | a94b9709b1ade947bc0eb916a803851a5639bd61 | |
parent | 30c873ed750df42b565ea44b937096d743903b52 (diff) |
added -C switch to native-code.py
Android is using this script as well, so the iOS change
needs to be hidden behind a flag
Change-Id: Ica9064278f0b64ad3f078c7951eef15e39f2b6da
-rw-r--r-- | ios/CustomTarget_iOS.mk | 20 | ||||
-rwxr-xr-x | solenv/bin/native-code.py | 5 |
2 files changed, 18 insertions, 7 deletions
diff --git a/ios/CustomTarget_iOS.mk b/ios/CustomTarget_iOS.mk index b07c6cbf99e8..e7f37778bf53 100644 --- a/ios/CustomTarget_iOS.mk +++ b/ios/CustomTarget_iOS.mk @@ -27,11 +27,20 @@ $(eval $(call gb_CustomTarget_CustomTarget,ios/ios)) $(call gb_CustomTarget_get_target,ios/ios): $(IOSGEN)/$(IOSKIT) +#- Setup directories --------------------------------------------------------- +IOSPREPARE: +ifeq ("$(wildcard $(IOSGEN))","") + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2) + + mkdir -p $(IOSGEN) $(IOSRES) $(IOSRES)/services \ + $(IOSRES)/share/config $(IOSRES)/share/filter $(IOSRES)/program \ + $(IOSGEN) $(WORKDIR)/ios; +endif + #- Generate xcconfig files --------------------------------------------------- -$(IOSKITXC) $(IOSAPPXC): $(BUILDDIR)/config_host.mk $(SRCDIR)/ios/CustomTarget_iOS.mk +$(IOSKITXC) $(IOSAPPXC): $(BUILDDIR)/config_host.mk $(SRCDIR)/ios/CustomTarget_iOS.mk IOSPREPARE $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2) - @mkdir -p $(IOSGEN) $(WORKDIR)/ios; sed -e "s'@BUILDDIR@'$(BUILDDIR)'g" \ -e "s'@INSTDIR@'$(INSTDIR)'g" \ -e "s'@SRCDIR@'$(SRC_ROOT)'g" \ @@ -53,12 +62,9 @@ $(IOSKITXC) $(IOSAPPXC): $(BUILDDIR)/config_host.mk $(SRCDIR)/ios/CustomTarget_i ifeq ("$(wildcard $(IOSRES))","") $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2) - mkdir -p $(IOSGEN) $(IOSRES) $(IOSRES)/services \ - $(IOSRES)/share/config $(IOSRES)/share/filter $(IOSRES)/program - # generate file with call declarations $(SRCDIR)/solenv/bin/native-code.py \ - -g core -g writer -g calc -g draw -g edit \ + -C -g core -g writer -g calc -g draw -g edit \ > $(IOSGEN)/native-code.h # generate resource files used to start/run LibreOffice @@ -109,7 +115,7 @@ endif #- build --------------------------------------------------------------------- -$(IOSGEN)/$(IOSKIT): $(IOSKITPRJ)/project.pbxproj $(IOSKITXC) $(IOSAPPXC) $(IOSKITSRC)/LibreOfficeKit.h $(IOSKITSRC)/LibreOfficeKit.c +$(IOSGEN)/$(IOSKIT): $(IOSKITXC) $(IOSAPPXC) IOSPREPARE $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2) CC=; \ $(call gb_Helper_print_on_error, \ diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 886c70a9cbfd..430a429e9b6d 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -408,6 +408,7 @@ opts = OptionParser() opts.add_option("-j", "--java-guard", action="store_true", help="include external java functions", dest="java", default=False) opts.add_option("-g", "--group", action="append", help="group of implementations to make available in application", dest="groups") opts.add_option("-r", "--limit-rdb", action="append", help="instead of outputting native-code.cxx, limit the services.rdb only to the services defined by the groups", dest="services") +opts.add_option("-C", "--pure-c", action="store_true", help="do not print extern \"C\"", dest="pure_c", default=False) (options, args) = opts.parse_args() @@ -447,6 +448,8 @@ print ("""/* #include <osl/detail/component-mapping.h> """) +if not options.pure_c: + print ("""extern "C" {""") for entry in sorted(full_factory_map.keys()): factory_function = full_factory_map[entry]['function'] @@ -520,5 +523,7 @@ print (""" } """) +if not options.pure_c: + print("""}""") # vim:set shiftwidth=4 softtabstop=4 expandtab: |