ios, prepare for multiple targets.
Moved common macros to CustomTarget_Lo_Xcconfig.mk to simplify each real target added link to workdir/ios (needed by xcodeproj) moved creation of configuration files to LO_Xcconfig, since they are identical for all ios projects central part of moving non git files to workdir completed changed relative path in project.pbxproj to be <project> instead of <group> Change-Id: I6be51f4d8a07ea7da08c0e5f1458fccfc3831a1e Reviewed-on: https://gerrit.libreoffice.org/34223 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@libreoffice.org>
This commit is contained in:
@@ -127,7 +127,6 @@ xcuserdata
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
DerivedData
|
||||
*.xcodeproj
|
||||
*.xcworkspace
|
||||
|
||||
# MSVS specific
|
||||
@@ -136,7 +135,6 @@ DerivedData
|
||||
*.sln
|
||||
*.v11*
|
||||
*.v12*
|
||||
*.vcxproj*
|
||||
*.opensdf
|
||||
!windows/*.sln
|
||||
!windows/*.vcxproj*
|
||||
|
||||
+2
-1
@@ -6,4 +6,5 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
|
||||
/lo.xcconfig
|
||||
ioswork
|
||||
lo.xcconfig
|
||||
|
||||
+117
-17
@@ -6,35 +6,135 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#- Env ------------------------------------------------------------------------
|
||||
IOSWORK := $(BUILDDIR)/workdir
|
||||
IOSDIR := $(IOSWORK)/ios
|
||||
IOSRESOURCE := $(IOSDIR)/resources
|
||||
IOSGENERATED := $(IOSDIR)/generated
|
||||
IOSLINK := $(SRCDIR)/ios/ioswork
|
||||
LO_XCCONFIG = $(IOSGENERATED)/lo.xcconfig
|
||||
|
||||
|
||||
#- Macros to be used, in each target ------------------------------------------
|
||||
define IOSbuild
|
||||
CC=; \
|
||||
$(call gb_Helper_print_on_error, \
|
||||
xcodebuild \
|
||||
-project $(SRCDIR)/ios/experimental/$(1)/$(1).xcodeproj \
|
||||
-target $(1) \
|
||||
-sdk $(XCODEBUILD_SDK) \
|
||||
-arch $(XCODE_ARCHS) \
|
||||
-configuration $(if $(ENABLE_DEBUG),Debug,Release) \
|
||||
$(2) \
|
||||
, $(IOSDIR)/$(1).log \
|
||||
)
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call gb_CustomTarget_CustomTarget,ios/Lo_Xcconfig))
|
||||
|
||||
LO_XCCONFIG = $(BUILDDIR)/ios/lo.xcconfig
|
||||
|
||||
$(call gb_CustomTarget_get_target,ios/Lo_Xcconfig): $(LO_XCCONFIG)
|
||||
|
||||
.PHONY : $(LO_XCCONFIG)
|
||||
|
||||
$(LO_XCCONFIG) :
|
||||
# Edit the Xcode configuration file:
|
||||
# - the list of all our (static) libs
|
||||
# - compiler flags
|
||||
#
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2)
|
||||
|
||||
# prepare work directories for all ios builds
|
||||
rm -rf $(IOSRESOURCE) $(IOSLINK) 2>/dev/null;
|
||||
mkdir -p $(IOSDIR) $(IOSGENERATED) $(IOSRESOURCE) $(IOSRESOURCE)/services;
|
||||
ln -s $(IOSWORK) $(IOSLINK)
|
||||
|
||||
# generate file with call declarations
|
||||
$(SRCDIR)/solenv/bin/native-code.py \
|
||||
-g core -g writer -g calc -g draw -g edit \
|
||||
> $(IOSGENERATED)/native-code.mm
|
||||
|
||||
# generate resource files used to start/run LibreOffice
|
||||
# copy rdb files
|
||||
cp $(INSTDIR)/program/types.rdb $(IOSRESOURCE)/udkapi.rdb
|
||||
cp $(INSTDIR)/program/types/offapi.rdb $(IOSRESOURCE)
|
||||
cp $(INSTDIR)/program/types/oovbaapi.rdb $(IOSRESOURCE)
|
||||
cp $(INSTDIR)/program/services/services.rdb $(IOSRESOURCE)/services
|
||||
cp $(INSTDIR)/program/services.rdb $(IOSRESOURCE)
|
||||
|
||||
# copy .res files
|
||||
# program/resource is hardcoded in tools/source/rc/resmgr.cxx. Sure,
|
||||
# we could set STAR_RESOURCE_PATH instead. sigh...
|
||||
mkdir -p $(IOSRESOURCE)/program/resource
|
||||
cp $(INSTDIR)/program/resource/*en-US.res $(IOSRESOURCE)/program/resource
|
||||
|
||||
# soffice.cfg
|
||||
mkdir -p $(IOSRESOURCE)/share/config
|
||||
cp -R $(INSTDIR)/share/config/soffice.cfg $(IOSRESOURCE)/share/config
|
||||
|
||||
# Japanese and Chinese dict files
|
||||
cp $(WORKDIR)/CustomTarget/i18npool/breakiterator/dict_*.data $(IOSRESOURCE)/share
|
||||
|
||||
# Drawing ML custom shape data files
|
||||
mkdir -p $(IOSRESOURCE)/share/filter
|
||||
cp $(INSTDIR)/share/filter/oox-drawingml-adj-names $(IOSRESOURCE)/share/filter
|
||||
cp $(INSTDIR)/share/filter/oox-drawingml-cs-presets $(IOSRESOURCE)/share/filter
|
||||
cp $(INSTDIR)/share/filter/vml-shape-types $(IOSRESOURCE)/share/filter
|
||||
|
||||
# "registry"
|
||||
cp -R $(INSTDIR)/share/registry $(IOSRESOURCE)/share
|
||||
|
||||
# Set up rc, the "inifile". See getIniFileName_Impl().
|
||||
file=$(IOSRESOURCE)/rc; \
|
||||
echo '[Bootstrap]' > $$file; \
|
||||
echo 'URE_BOOTSTRAP=file://$$APP_DATA_DIR/fundamentalrc' >> $$file; \
|
||||
echo 'HOME=$$SYSUSERHOME' >> $$file
|
||||
|
||||
# Set up fundamentalrc, unorc, bootstraprc and versionrc.
|
||||
# Do we really need all these?
|
||||
file=$(IOSRESOURCE)/fundamentalrc; \
|
||||
echo '[Bootstrap]' > $$file; \
|
||||
echo 'LO_LIB_DIR=file://$$APP_DATA_DIR/lib/' >> $$file; \
|
||||
echo 'BRAND_BASE_DIR=file://$$APP_DATA_DIR' >> $$file; \
|
||||
echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry res:$${BRAND_BASE_DIR}/registry' >> $$file; \
|
||||
echo 'UNO_TYPES=file://$$APP_DATA_DIR/udkapi.rdb file://$$APP_DATA_DIR/offapi.rdb' >> $$file; \
|
||||
echo 'UNO_SERVICES=file://$$APP_DATA_DIR/services.rdb file://$$APP_DATA_DIR/services/services.rdb' >> $$file; \
|
||||
echo 'OSL_SOCKET_PATH=$$APP_DATA_DIR/cache' >> $$file
|
||||
|
||||
file=$(IOSRESOURCE)/unorc; \
|
||||
echo '[Bootstrap]' > $$file;
|
||||
|
||||
# bootstraprc must be in $BRAND_BASE_DIR/program
|
||||
mkdir -p $(IOSRESOURCE)/program
|
||||
file=$(IOSRESOURCE)/program/bootstraprc; \
|
||||
echo '[Bootstrap]' > $$file; \
|
||||
echo 'InstallMode=<installmode>' >> $$file; \
|
||||
echo "ProductKey=LibreOffice $(PRODUCTVERSION)" >> $$file; \
|
||||
echo 'UserInstallation=$$SYSUSERHOME/userinstallation' >> $$file;
|
||||
|
||||
# Is this really needed?
|
||||
file=$(IOSRESOURCE)/program/versionrc; \
|
||||
echo '[Version]' > $$file; \
|
||||
echo 'AllLanguages=en-US' >> $$file; \
|
||||
echo 'BuildVersion=' >> $$file; \
|
||||
echo "buildid=$(BUILDID)" >> $$file;
|
||||
|
||||
# Edit the Xcode configuration file generated by autogen.sh:
|
||||
# - the list of all our (static) libs
|
||||
# - compiler flags
|
||||
#
|
||||
all_libs=`$(SRCDIR)/bin/lo-all-static-libs`; \
|
||||
\
|
||||
sed -e "s;^\(LINK_LDFLAGS =\).*$$;\1 -Wl,-map,$(WORKDIR)/\$$(TARGET_NAME).map $$all_libs;" \
|
||||
sed -e "s;^\(LINK_LDFLAGS =\).*$$;\1 -Wl,-lz,-liconv,-map,$(WORKDIR)/\$$(TARGET_NAME).map $$all_libs;" \
|
||||
-e "s,^\(OTHER_CFLAGS =\).*$$,\1 $(gb_GLOBALDEFS)," \
|
||||
-e "s,^\(OTHER_CPLUSPLUSFLAGS =\).*$$,\1 $(gb_GLOBALDEFS)," \
|
||||
< $(LO_XCCONFIG) > $(LO_XCCONFIG).new && mv $(LO_XCCONFIG).new $(LO_XCCONFIG)
|
||||
< $(BUILDDIR)/ios/lo.xcconfig > $(LO_XCCONFIG)
|
||||
|
||||
# When SRCDIR!=BUILDDIR, Xcode is used on the project in the
|
||||
# *source* tree (because that is where the source files are). Copy
|
||||
# the configuration file to the corresponding source dir so that
|
||||
# Xcode can find it.
|
||||
if test $(SRCDIR) != $(BUILDDIR); then \
|
||||
cp $(LO_XCCONFIG) $(SRCDIR)/ios; \
|
||||
fi
|
||||
# Do *not* remove $(LO_XCCONFIG) in a clean target. It is created
|
||||
# during configure, not in this custom gbuild makefile.
|
||||
|
||||
|
||||
$(call gb_CustomTarget_get_clean_target,ios/Lo_Xcconfig):
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),ENV,2)
|
||||
rm -rf $(IOSDIR)
|
||||
rm -f $(IOSLINK)
|
||||
rm -f $(WORKDIR)/CustomTarget/ios/Lo_Xcconfig.done
|
||||
|
||||
# Do *not* remove $(LO_XCCONFIG) in a clean target. It is created
|
||||
# during configure, not in this custom gbuild makefile.
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
||||
|
||||
@@ -7,26 +7,8 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#- Env ------------------------------------------------------------------------
|
||||
|
||||
TiledLibreOffice_resource := experimental/TiledLibreOffice/Resources
|
||||
BUILDID :=$(shell cd $(SRCDIR) && git log -1 --format=%H)
|
||||
|
||||
#- Macros ---------------------------------------------------------------------
|
||||
|
||||
define TiledLibreOfficeXcodeBuild
|
||||
CC=; \
|
||||
$(call gb_Helper_print_on_error, \
|
||||
xcodebuild \
|
||||
-project experimental/TiledLibreOffice/TiledLibreOffice.xcodeproj \
|
||||
-target TiledLibreOffice \
|
||||
-sdk $(XCODEBUILD_SDK) \
|
||||
-arch $(XCODE_ARCHS) \
|
||||
-configuration $(if $(ENABLE_DEBUG),Debug,Release) \
|
||||
$(1) \
|
||||
, $$@.log \
|
||||
)
|
||||
endef
|
||||
|
||||
#- Targets --------------------------------------------------------------------
|
||||
|
||||
.PHONY: TiledLibreOffice_setup
|
||||
@@ -36,89 +18,13 @@ $(eval $(call gb_CustomTarget_CustomTarget,ios/TiledLibreOffice))
|
||||
|
||||
# Build
|
||||
# Depend on the custom target that sets up lo.xcconfig
|
||||
$(call gb_CustomTarget_get_target,ios/TiledLibreOffice): $(call gb_CustomTarget_get_target,ios/Lo_Xcconfig) TiledLibreOffice_setup
|
||||
$(call gb_CustomTarget_get_target,ios/TiledLibreOffice): $(call gb_CustomTarget_get_target,ios/Lo_Xcconfig)
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
|
||||
$(SRCDIR)/solenv/bin/native-code.py \
|
||||
-g core -g writer -g calc -g draw -g edit \
|
||||
> $(SRCDIR)/ios/experimental/TiledLibreOffice/TiledLibreOffice/native-code.mm
|
||||
$(call TiledLibreOfficeXcodeBuild, clean build)
|
||||
|
||||
# Setup
|
||||
TiledLibreOffice_setup:
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2)
|
||||
|
||||
# Resources #
|
||||
rm -rf $(TiledLibreOffice_resource) 2>/dev/null
|
||||
mkdir -p $(TiledLibreOffice_resource)
|
||||
mkdir -p $(TiledLibreOffice_resource)/services
|
||||
|
||||
# copy rdb files
|
||||
cp $(INSTDIR)/program/types.rdb $(TiledLibreOffice_resource)/udkapi.rdb
|
||||
cp $(INSTDIR)/program/types/offapi.rdb $(TiledLibreOffice_resource)
|
||||
cp $(INSTDIR)/program/types/oovbaapi.rdb $(TiledLibreOffice_resource)
|
||||
cp $(INSTDIR)/program/services/services.rdb $(TiledLibreOffice_resource)/services
|
||||
cp $(INSTDIR)/program/services.rdb $(TiledLibreOffice_resource)
|
||||
|
||||
# copy .res files
|
||||
# program/resource is hardcoded in tools/source/rc/resmgr.cxx. Sure,
|
||||
# we could set STAR_RESOURCE_PATH instead. sigh...
|
||||
mkdir -p $(TiledLibreOffice_resource)/program/resource
|
||||
cp $(INSTDIR)/program/resource/*en-US.res $(TiledLibreOffice_resource)/program/resource
|
||||
|
||||
# soffice.cfg
|
||||
mkdir -p $(TiledLibreOffice_resource)/share/config
|
||||
cp -R $(INSTDIR)/share/config/soffice.cfg $(TiledLibreOffice_resource)/share/config
|
||||
|
||||
# Japanese and Chinese dict files
|
||||
cp $(WORKDIR)/CustomTarget/i18npool/breakiterator/dict_*.data $(TiledLibreOffice_resource)/share
|
||||
|
||||
# Drawing ML custom shape data files
|
||||
mkdir -p $(TiledLibreOffice_resource)/share/filter
|
||||
cp $(INSTDIR)/share/filter/oox-drawingml-adj-names $(TiledLibreOffice_resource)/share/filter
|
||||
cp $(INSTDIR)/share/filter/oox-drawingml-cs-presets $(TiledLibreOffice_resource)/share/filter
|
||||
cp $(INSTDIR)/share/filter/vml-shape-types $(TiledLibreOffice_resource)/share/filter
|
||||
|
||||
# "registry"
|
||||
cp -R $(INSTDIR)/share/registry $(TiledLibreOffice_resource)/share
|
||||
|
||||
# Set up rc, the "inifile". See getIniFileName_Impl().
|
||||
file=$(TiledLibreOffice_resource)/rc; \
|
||||
echo '[Bootstrap]' > $$file; \
|
||||
echo 'URE_BOOTSTRAP=file://$$APP_DATA_DIR/fundamentalrc' >> $$file; \
|
||||
echo 'HOME=$$SYSUSERHOME' >> $$file;
|
||||
|
||||
# Set up fundamentalrc, unorc, bootstraprc and versionrc.
|
||||
# Do we really need all these?
|
||||
file=$(TiledLibreOffice_resource)/fundamentalrc; \
|
||||
echo '[Bootstrap]' > $$file; \
|
||||
echo 'LO_LIB_DIR=file://$$APP_DATA_DIR/lib/' >> $$file; \
|
||||
echo 'BRAND_BASE_DIR=file://$$APP_DATA_DIR' >> $$file; \
|
||||
echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry res:$${BRAND_BASE_DIR}/registry' >> $$file; \
|
||||
echo 'UNO_TYPES=file://$$APP_DATA_DIR/udkapi.rdb file://$$APP_DATA_DIR/offapi.rdb' >> $$file; \
|
||||
echo 'UNO_SERVICES=file://$$APP_DATA_DIR/services.rdb file://$$APP_DATA_DIR/services/services.rdb' >> $$file; \
|
||||
echo 'OSL_SOCKET_PATH=$$APP_DATA_DIR/cache' >> $$file
|
||||
|
||||
file=$(TiledLibreOffice_resource)/unorc; \
|
||||
echo '[Bootstrap]' > $$file;
|
||||
|
||||
# bootstraprc must be in $BRAND_BASE_DIR/program
|
||||
mkdir -p $(TiledLibreOffice_resource)/program
|
||||
file=$(TiledLibreOffice_resource)/program/bootstraprc; \
|
||||
echo '[Bootstrap]' > $$file; \
|
||||
echo 'InstallMode=<installmode>' >> $$file; \
|
||||
echo "ProductKey=LibreOffice $(PRODUCTVERSION)" >> $$file; \
|
||||
echo 'UserInstallation=$$SYSUSERHOME/userinstallation' >> $$file;
|
||||
|
||||
# Is this really needed?
|
||||
file=$(TiledLibreOffice_resource)/program/versionrc; \
|
||||
echo '[Version]' > $$file; \
|
||||
echo 'AllLanguages=en-US' >> $$file; \
|
||||
echo 'BuildVersion=' >> $$file; \
|
||||
echo "buildid=$(BUILDID)" >> $$file;
|
||||
$(call IOSbuild,TiledLibreOffice, clean build)
|
||||
|
||||
# Clean
|
||||
$(call gb_CustomTarget_get_clean_target,ios/TiledLibreOffice):
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),APP,2)
|
||||
$(call TiledLibreOfficeXcodeBuild, clean)
|
||||
$(call IOSbuild,TiledLibreOffice, clean)
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.libreoffice.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -24,12 +24,12 @@
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIFileSharingEnabled</key>
|
||||
<true/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UIFileSharingEnabled</key>
|
||||
<true/>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
|
||||
+1
-1
@@ -29,4 +29,4 @@ DEBUG_INFORMATION_FORMAT=@XCODE_DEBUG_INFORMATION_FORMAT@
|
||||
LINK_LDFLAGS =
|
||||
OTHER_CFLAGS =
|
||||
OTHER_CPLUSPLUSFLAGS =
|
||||
SYMROOT = @BUILDDIR@/ios/TiledLibreOffice
|
||||
SYMROOT = @WORKDIR@/ios/build
|
||||
|
||||
Reference in New Issue
Block a user