Merge pull request #9 from nventive/dev/djo/calcmanager-ios

Build CalcManager on iOS
This commit is contained in:
David Oliver 2019-05-21 13:05:32 -04:00 committed by GitHub
commit c701d3a081
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 40 additions and 5 deletions

View file

@ -40,7 +40,7 @@ struct CalculatorManager_CreateParams {
GetCEngineStringFunc GetCEngineString;
};
#if defined(__EMSCRIPTEN__)
#if defined(__EMSCRIPTEN__) || defined(__APPLE__)
#define DLL_EXPORT
#else
#define DLL_EXPORT __declspec(dllexport)

View file

@ -14,7 +14,7 @@ static constexpr size_t SERIALIZED_NUMBER_MINSIZE = 3;
// Converts Memory Command enum value to unsigned char,
// while ignoring Warning C4309: 'conversion' : truncation of constant value
#if defined(__EMSCRIPTEN__)
#if defined(__EMSCRIPTEN__) || defined(__APPLE__)
#define MEMORY_COMMAND_TO_UNSIGNED_CHAR(c) static_cast<unsigned char>(c)
#else
#define MEMORY_COMMAND_TO_UNSIGNED_CHAR(c) __pragma(warning(push)) __pragma(warning(disable : 4309)) static_cast<unsigned char>(c) __pragma(warning(pop))

View file

@ -10,7 +10,7 @@
#include "Ratpack/CalcErr.h"
#include <stdexcept> // for std::out_of_range
#if !defined(__EMSCRIPTEN__)
#if !defined(__EMSCRIPTEN__) && !defined(__APPLE__)
#include <winerror.h>
#include <sal.h> // for SAL
#endif

35
src/CalcManager/build_ios.sh Executable file
View file

@ -0,0 +1,35 @@
xcrun -sdk iphoneos clang \
-x c++ \
-arch arm64 \
-std=c++1z \
-stdlib=libc++ \
-c \
CEngine/*.cpp RatPack/*.cpp *.cpp -I.
mkdir bin
mkdir bin/arm64
libtool \
-static \
*.o \
-o bin/arm64/libCalcManager.a
rm *.o
clang \
-x c++ \
-arch x86_64 \
-std=c++1z \
-stdlib=libc++ \
-c \
CEngine/*.cpp RatPack/*.cpp *.cpp -I.
mkdir bin/x86_64
libtool \
-static \
*.o \
-o bin/x86_64/libCalcManager.a
rm *.o

View file

@ -1,6 +1,6 @@
#pragma once
#if defined(__EMSCRIPTEN__)
#if defined(__EMSCRIPTEN__) || defined(__APPLE__)
#define HRESULT long
#define _In_opt_

View file

@ -18,7 +18,7 @@
#include <unordered_map>
#include <vector>
#if !defined(__EMSCRIPTEN__)
#if !defined(__EMSCRIPTEN__) && !defined(__APPLE__)
#include <ppltasks.h>
#include <winerror.h>
#include <intsafe.h>