mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-23 06:25:19 -07:00
Build CalcManager on iOS
- Add iOS build script (needs to run on MacOS with XCode) - fixes to build
This commit is contained in:
parent
a550a60428
commit
21e0d284f6
7 changed files with 41 additions and 6 deletions
|
@ -40,7 +40,7 @@ struct CalculatorManager_CreateParams {
|
||||||
GetCEngineStringFunc GetCEngineString;
|
GetCEngineStringFunc GetCEngineString;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(__EMSCRIPTEN__)
|
#if defined(__EMSCRIPTEN__) || defined(__APPLE__)
|
||||||
#define DLL_EXPORT
|
#define DLL_EXPORT
|
||||||
#else
|
#else
|
||||||
#define DLL_EXPORT __declspec(dllexport)
|
#define DLL_EXPORT __declspec(dllexport)
|
||||||
|
|
|
@ -14,7 +14,7 @@ static constexpr size_t SERIALIZED_NUMBER_MINSIZE = 3;
|
||||||
|
|
||||||
// Converts Memory Command enum value to unsigned char,
|
// Converts Memory Command enum value to unsigned char,
|
||||||
// while ignoring Warning C4309: 'conversion' : truncation of constant value
|
// 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)
|
#define MEMORY_COMMAND_TO_UNSIGNED_CHAR(c) static_cast<unsigned char>(c)
|
||||||
#else
|
#else
|
||||||
#define MEMORY_COMMAND_TO_UNSIGNED_CHAR(c) __pragma(warning(push)) __pragma(warning(disable : 4309)) static_cast<unsigned char>(c) __pragma(warning(pop))
|
#define MEMORY_COMMAND_TO_UNSIGNED_CHAR(c) __pragma(warning(push)) __pragma(warning(disable : 4309)) static_cast<unsigned char>(c) __pragma(warning(pop))
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "Ratpack/CalcErr.h"
|
#include "Ratpack/CalcErr.h"
|
||||||
#include <stdexcept> // for std::out_of_range
|
#include <stdexcept> // for std::out_of_range
|
||||||
|
|
||||||
#if !defined(__EMSCRIPTEN__)
|
#if !defined(__EMSCRIPTEN__) && !defined(__APPLE__)
|
||||||
#include <winerror.h>
|
#include <winerror.h>
|
||||||
#include <sal.h> // for SAL
|
#include <sal.h> // for SAL
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -49,7 +49,7 @@ wchar_t g_decimalSeparator = L'.';
|
||||||
#define Calc_UInt32x32To64(a, b) ((uint64_t)((uint32_t)(a)) * (uint64_t)((uint32_t)(b)))
|
#define Calc_UInt32x32To64(a, b) ((uint64_t)((uint32_t)(a)) * (uint64_t)((uint32_t)(b)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined(_M_IX86) || defined(__i386__) || defined(_M_ARM) || defined(__EMSCRIPTEN__)
|
#elif defined(_M_IX86) || defined(__i386__) || defined(_M_ARM) || defined(__EMSCRIPTEN__) || defined(__APPLE__)
|
||||||
|
|
||||||
#ifndef Calc_UInt32x32To64
|
#ifndef Calc_UInt32x32To64
|
||||||
#define Calc_UInt32x32To64(a, b) (uint64_t)((uint64_t)(uint32_t)(a) * (uint32_t)(b))
|
#define Calc_UInt32x32To64(a, b) (uint64_t)((uint64_t)(uint32_t)(a) * (uint32_t)(b))
|
||||||
|
|
35
src/CalcManager/build_ios.sh
Executable file
35
src/CalcManager/build_ios.sh
Executable 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
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(__EMSCRIPTEN__)
|
#if defined(__EMSCRIPTEN__) || defined(__APPLE__)
|
||||||
|
|
||||||
#define HRESULT long
|
#define HRESULT long
|
||||||
#define _In_opt_
|
#define _In_opt_
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if !defined(__EMSCRIPTEN__)
|
#if !defined(__EMSCRIPTEN__) && !defined(__APPLE__)
|
||||||
#include <ppltasks.h>
|
#include <ppltasks.h>
|
||||||
#include <winerror.h>
|
#include <winerror.h>
|
||||||
#include <intsafe.h>
|
#include <intsafe.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue