diff options
author | jan Iversen <jani@libreoffice.org> | 2017-09-26 12:54:40 +0200 |
---|---|---|
committer | jan Iversen <jani@libreoffice.org> | 2017-09-26 18:22:03 +0200 |
commit | 11f001f1a05684c87615e74a1edab300409bf6c6 (patch) | |
tree | 3707b57c907cb50be63c82561dc600143eed6c18 /ios/LibreOfficeKit | |
parent | 4bf3b4ee48c4e3556e257aa77940f68c13b05b54 (diff) |
iOS, build instructions.
Added README with instruction on how to build for
the different platforms, updated iOS files corresponding
Change-Id: I8a85f808841d682bc09f1e3b039192e342ecc484
Diffstat (limited to 'ios/LibreOfficeKit')
-rw-r--r-- | ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj | 304 | ||||
-rw-r--r-- | ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h | 8 | ||||
-rw-r--r-- | ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.mm | 59 | ||||
-rw-r--r-- | ios/LibreOfficeKit/lo_kit.xcconfig.in | 32 |
4 files changed, 403 insertions, 0 deletions
diff --git a/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj b/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..0bb2386137bd --- /dev/null +++ b/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj @@ -0,0 +1,304 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 39B5D21A1F78130F008FB162 /* LibreOfficeKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39B5D2191F78130F008FB162 /* LibreOfficeKit.mm */; }; + 39B5D21B1F78130F008FB162 /* LibreOfficeKit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 39B5D2181F78130F008FB162 /* LibreOfficeKit.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 39B5D2131F78130F008FB162 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + 39B5D21B1F78130F008FB162 /* LibreOfficeKit.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 39B5D2151F78130F008FB162 /* libLibreOfficeKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libLibreOfficeKit.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 39B5D2181F78130F008FB162 /* LibreOfficeKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LibreOfficeKit.h; sourceTree = "<group>"; }; + 39B5D2191F78130F008FB162 /* LibreOfficeKit.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LibreOfficeKit.mm; sourceTree = "<group>"; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 39B5D2121F78130F008FB162 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3969A8C91F782610006F06A9 /* Support files */ = { + isa = PBXGroup; + children = ( + ); + name = "Support files"; + sourceTree = "<group>"; + }; + 39B5D20C1F78130F008FB162 = { + isa = PBXGroup; + children = ( + 39B5D2171F78130F008FB162 /* LibreOfficeKit */, + 39B5D2161F78130F008FB162 /* Products */, + 3969A8C91F782610006F06A9 /* Support files */, + ); + sourceTree = "<group>"; + }; + 39B5D2161F78130F008FB162 /* Products */ = { + isa = PBXGroup; + children = ( + 39B5D2151F78130F008FB162 /* libLibreOfficeKit.a */, + ); + name = Products; + sourceTree = "<group>"; + }; + 39B5D2171F78130F008FB162 /* LibreOfficeKit */ = { + isa = PBXGroup; + children = ( + 39B5D2181F78130F008FB162 /* LibreOfficeKit.h */, + 39B5D2191F78130F008FB162 /* LibreOfficeKit.mm */, + ); + path = LibreOfficeKit; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 39B5D2141F78130F008FB162 /* LibreOfficeKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 39B5D21E1F78130F008FB162 /* Build configuration list for PBXNativeTarget "LibreOfficeKit" */; + buildPhases = ( + 39B5D2111F78130F008FB162 /* Sources */, + 39B5D2121F78130F008FB162 /* Frameworks */, + 39B5D2131F78130F008FB162 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = LibreOfficeKit; + productName = LibreOfficeKit; + productReference = 39B5D2151F78130F008FB162 /* libLibreOfficeKit.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 39B5D20D1F78130F008FB162 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0830; + ORGANIZATIONNAME = jani; + TargetAttributes = { + 39B5D2141F78130F008FB162 = { + CreatedOnToolsVersion = 8.3; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 39B5D2101F78130F008FB162 /* Build configuration list for PBXProject "LibreOfficeKit" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 39B5D20C1F78130F008FB162; + productRefGroup = 39B5D2161F78130F008FB162 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 39B5D2141F78130F008FB162 /* LibreOfficeKit */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 39B5D2111F78130F008FB162 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 39B5D21A1F78130F008FB162 /* LibreOfficeKit.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 39B5D21C1F78130F008FB162 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(LO_BUILDDIR)/config_host", + "$(LO_SRCDIR)/include", + "$(LO_WORKDIR)/UnoApiHeadersTarget/udkapi/comprehensive", + "$(LO_WORKDIR)/UnoApiHeadersTarget/offapi/comprehensive", + "$(LO_WORKDIR)/UnpackedTarball/icu/source/common", + "$(LO_WORKDIR)/ios/generated", + ); + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "$(LINK_LDFLAGS)", + "-lstdc++", + ); + SDKROOT = iphoneos; + VALID_ARCHS = arm64; + }; + name = Debug; + }; + 39B5D21D1F78130F008FB162 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(LO_BUILDDIR)/config_host", + "$(LO_SRCDIR)/include", + "$(LO_WORKDIR)/UnoApiHeadersTarget/udkapi/comprehensive", + "$(LO_WORKDIR)/UnoApiHeadersTarget/offapi/comprehensive", + "$(LO_WORKDIR)/UnpackedTarball/icu/source/common", + "$(LO_WORKDIR)/ios/generated", + ); + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ( + "$(LINK_LDFLAGS)", + "-lstdc++", + ); + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + VALID_ARCHS = arm64; + "VALID_ARCHS[sdk=*]" = arm64; + }; + name = Release; + }; + 39B5D21F1F78130F008FB162 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 39B5D2201F78130F008FB162 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 39B5D2101F78130F008FB162 /* Build configuration list for PBXProject "LibreOfficeKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 39B5D21C1F78130F008FB162 /* Debug */, + 39B5D21D1F78130F008FB162 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 39B5D21E1F78130F008FB162 /* Build configuration list for PBXNativeTarget "LibreOfficeKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 39B5D21F1F78130F008FB162 /* Debug */, + 39B5D2201F78130F008FB162 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 39B5D20D1F78130F008FB162 /* Project object */; +} diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h new file mode 100644 index 000000000000..3d4366495382 --- /dev/null +++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h @@ -0,0 +1,8 @@ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. +// + diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.mm b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.mm new file mode 100644 index 000000000000..5c15360ae28b --- /dev/null +++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.mm @@ -0,0 +1,59 @@ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. +// +#import "LibreOfficeKit.h" + +#include <stdio.h> +#include <TargetConditionals.h> +#define LOK_USE_UNSTABLE_API +#include <LibreOfficeKit/LibreOfficeKitInit.h> + +#include <osl/process.h> + +#include <unicode/udata.h> +#include <unicode/ucnv.h> + +// generated by solenv/bin/native-code.py: +#include "native-code.mm" + + +// Force reference to libreofficekit_hook +#ifdef LINK_LOKIT +extern "C" __attribute__((used)) void *libreofficekit_hook(const char *); +static __attribute__((used)) void *(*foop)(const char *) = libreofficekit_hook; + +// pointers to our instance +static LibreOfficeKit* kit; +static LibreOfficeKitDocument* document; +#endif + + + +// Bridge functions to LibreOfficeKit +extern "C" int BridgeLOkit_Init(const char *path) +{ +#ifdef LINK_LOKIT + char bufUserPath[200]; + strcpy(bufUserPath, path); + strcpy(bufUserPath + strlen(path), "/user"); + + // Initialize LibreOfficeKit + if (!kit) + kit = lok_init_2(path, bufUserPath); +#endif + return 0; +} + +int LOkit_open(char *file) +{ +#ifdef LINK_LOKIT + document = kit->pClass->documentLoad(kit, file); + document->pClass->initializeForRendering(document, ""); +#endif + return 0; +} + diff --git a/ios/LibreOfficeKit/lo_kit.xcconfig.in b/ios/LibreOfficeKit/lo_kit.xcconfig.in new file mode 100644 index 000000000000..08623d8a9067 --- /dev/null +++ b/ios/LibreOfficeKit/lo_kit.xcconfig.in @@ -0,0 +1,32 @@ +// -*- Mode: text; tab-width: 4; indent-tabs-mode: nil; word-wrap: nil -*- +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. + +// Xcode configuration properties + +// To avoid confusion, the LO-specific ones that aren't as such used +// by Xcode (but only expanded in option values) are prefixed with +// LO_. + +LO_BUILDDIR = @BUILDDIR@ +LO_INSTDIR = @INSTDIR@ +LO_SRCDIR = @SRC_ROOT@ +LO_WORKDIR = @WORKDIR@ + +// These are actual Xcode-known settings. The corresponding autoconf +// variables are prefixed with XCODE_ to make it clear in configure.ac +// what they will be used for. +ARCHS = @XCODE_ARCHS@ +VALID_ARCHS = @XCODE_ARCHS@ +CLANG_CXX_LIBRARY = @XCODE_CLANG_CXX_LIBRARY@ +DEBUG_INFORMATION_FORMAT=@XCODE_DEBUG_INFORMATION_FORMAT@ + +// These settings are edited in CustomTarget_Lo_Xcconfig.mk. +LINK_LDFLAGS = +OTHER_CFLAGS = +OTHER_CPLUSPLUSFLAGS = +SYMROOT = @WORKDIR@/ios/build |