mirror of
https://github.com/MAGICGrants/flutter_libsparkmobile.git
synced 2026-01-09 21:17:56 -05:00
WIP macos build
This commit is contained in:
@@ -21,12 +21,14 @@
|
||||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2007D997287ADCF85D863FB6 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B68A1BCD767703D33955A7F /* Pods_RunnerTests.framework */; };
|
||||
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };
|
||||
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
|
||||
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
|
||||
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
||||
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
||||
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
||||
CCF43442AC7DA7618F9ECE87 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD9928F4E6D3D2EE262D0A8A /* Pods_Runner.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -60,11 +62,13 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2B68A1BCD767703D33955A7F /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
302EE047692D6694B77F3A9B /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
|
||||
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
|
||||
33CC10ED2044A3C60003C045 /* flutter_libsparkmobile_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flutter_libsparkmobile_example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
33CC10ED2044A3C60003C045 /* flutter_libsparkmobile_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = flutter_libsparkmobile_example.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
|
||||
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
@@ -76,8 +80,14 @@
|
||||
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
||||
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
||||
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
||||
7362EDC01A09F4CEDB4C8EDE /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
||||
8EAB039DE8286E47EF82C7C8 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
||||
A055E5D05392165A8B2D45CB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
E92510024970BEE0F6B127E0 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
F94113FA20FB3E8F60F398B1 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
FD9928F4E6D3D2EE262D0A8A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -85,6 +95,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2007D997287ADCF85D863FB6 /* Pods_RunnerTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -92,12 +103,27 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CCF43442AC7DA7618F9ECE87 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
049E5069BBD927E3848242AB /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E92510024970BEE0F6B127E0 /* Pods-Runner.debug.xcconfig */,
|
||||
8EAB039DE8286E47EF82C7C8 /* Pods-Runner.release.xcconfig */,
|
||||
A055E5D05392165A8B2D45CB /* Pods-Runner.profile.xcconfig */,
|
||||
7362EDC01A09F4CEDB4C8EDE /* Pods-RunnerTests.debug.xcconfig */,
|
||||
302EE047692D6694B77F3A9B /* Pods-RunnerTests.release.xcconfig */,
|
||||
F94113FA20FB3E8F60F398B1 /* Pods-RunnerTests.profile.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
331C80D6294CF71000263BE5 /* RunnerTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -125,6 +151,7 @@
|
||||
331C80D6294CF71000263BE5 /* RunnerTests */,
|
||||
33CC10EE2044A3C60003C045 /* Products */,
|
||||
D73912EC22F37F3D000D13A0 /* Frameworks */,
|
||||
049E5069BBD927E3848242AB /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -175,6 +202,8 @@
|
||||
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FD9928F4E6D3D2EE262D0A8A /* Pods_Runner.framework */,
|
||||
2B68A1BCD767703D33955A7F /* Pods_RunnerTests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -186,6 +215,7 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||
buildPhases = (
|
||||
9E60EA0C921D001EC5656FEE /* [CP] Check Pods Manifest.lock */,
|
||||
331C80D1294CF70F00263BE5 /* Sources */,
|
||||
331C80D2294CF70F00263BE5 /* Frameworks */,
|
||||
331C80D3294CF70F00263BE5 /* Resources */,
|
||||
@@ -204,11 +234,13 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
A684907ACE4FB0B72BA8E90D /* [CP] Check Pods Manifest.lock */,
|
||||
33CC10E92044A3C60003C045 /* Sources */,
|
||||
33CC10EA2044A3C60003C045 /* Frameworks */,
|
||||
33CC10EB2044A3C60003C045 /* Resources */,
|
||||
33CC110E2044A8840003C045 /* Bundle Framework */,
|
||||
3399D490228B24CF009A79C7 /* ShellScript */,
|
||||
188030BC38B34B21809EEBD4 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -290,6 +322,23 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
188030BC38B34B21809EEBD4 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3399D490228B24CF009A79C7 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
@@ -328,6 +377,50 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
|
||||
};
|
||||
9E60EA0C921D001EC5656FEE /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
A684907ACE4FB0B72BA8E90D /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@@ -379,6 +472,7 @@
|
||||
/* Begin XCBuildConfiguration section */
|
||||
331C80DB294CF71000263BE5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7362EDC01A09F4CEDB4C8EDE /* Pods-RunnerTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
@@ -393,6 +487,7 @@
|
||||
};
|
||||
331C80DC294CF71000263BE5 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 302EE047692D6694B77F3A9B /* Pods-RunnerTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
@@ -407,6 +502,7 @@
|
||||
};
|
||||
331C80DD294CF71000263BE5 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = F94113FA20FB3E8F60F398B1 /* Pods-RunnerTests.profile.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
|
||||
@@ -4,4 +4,7 @@
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||
<orderEntry type="library" name="Dart Packages" level="project" />
|
||||
<orderEntry type="library" name="Flutter Plugins" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,3 +0,0 @@
|
||||
// Relative import to be able to reuse the C sources.
|
||||
// See the comment in ../{projectName}}.podspec for more information.
|
||||
#include flutter_libsparkmobile.cpp
|
||||
@@ -18,7 +18,7 @@ A new Flutter project.
|
||||
# paths, so Classes contains a forwarder C file that relatively imports
|
||||
# `../src/*` so that the C sources can be shared among all target platforms.
|
||||
s.source = { :path => '.' }
|
||||
s.source_files = 'Classes/**/*'
|
||||
s.vendored_frameworks = 'flutter_libsparkmobile.framework'
|
||||
s.dependency 'FlutterMacOS'
|
||||
|
||||
s.platform = :osx, '10.11'
|
||||
|
||||
23
scripts/macos/build_all.sh
Executable file
23
scripts/macos/build_all.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
export MACOS_SCRIPTS_DIR=`pwd`
|
||||
export PROJECT_ROOT_DIR="${MACOS_SCRIPTS_DIR}/../.."
|
||||
export MOBILE_LIB_ROOT="${PROJECT_ROOT_DIR}/src"
|
||||
export EXTERNAL_MACOS_DIR="${MOBILE_LIB_ROOT}/build/macos"
|
||||
export EXTERNAL_MACOS_SOURCE_DIR=${EXTERNAL_MACOS_DIR}/sources
|
||||
export EXTERNAL_MACOS_LIB_DIR=${EXTERNAL_MACOS_DIR}/lib
|
||||
export EXTERNAL_MACOS_INCLUDE_DIR=${EXTERNAL_MACOS_DIR}/include
|
||||
|
||||
mkdir -p $EXTERNAL_MACOS_DIR
|
||||
mkdir -p $EXTERNAL_MACOS_LIB_DIR
|
||||
mkdir -p $EXTERNAL_MACOS_INCLUDE_DIR
|
||||
mkdir -p $EXTERNAL_MACOS_SOURCE_DIR
|
||||
|
||||
./build_openssl_arm64.sh
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../../../src -DBUILD_FOR_SYSTEM_NAME="macos" && make -j12
|
||||
cp -R flutter_libsparkmobile.framework "${PROJECT_ROOT_DIR}/macos/"
|
||||
4
scripts/macos/build_openssl_arm64.sh
Executable file
4
scripts/macos/build_openssl_arm64.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ./build_openssl_common.sh
|
||||
build_openssl_arm64
|
||||
122
scripts/macos/build_openssl_common.sh
Executable file
122
scripts/macos/build_openssl_common.sh
Executable file
@@ -0,0 +1,122 @@
|
||||
#!/bin/sh
|
||||
|
||||
export MACOS_SCRIPTS_DIR=`pwd`
|
||||
export PROJECT_ROOT_DIR="${MACOS_SCRIPTS_DIR}/../.."
|
||||
export MOBILE_LIB_ROOT="${PROJECT_ROOT_DIR}/src"
|
||||
export EXTERNAL_MACOS_DIR="${MOBILE_LIB_ROOT}/build/macos"
|
||||
export EXTERNAL_MACOS_SOURCE_DIR=${EXTERNAL_MACOS_DIR}/sources
|
||||
export EXTERNAL_MACOS_LIB_DIR=${EXTERNAL_MACOS_DIR}/lib
|
||||
export EXTERNAL_MACOS_INCLUDE_DIR=${EXTERNAL_MACOS_DIR}/include
|
||||
|
||||
OPEN_SSL_DIR_NAME="OpenSSL"
|
||||
OPEN_SSL_x86_64_DIR_NAME="${OPEN_SSL_DIR_NAME}-x86_64"
|
||||
OPEN_SSL_ARM_DIR_NAME="${OPEN_SSL_DIR_NAME}-arm"
|
||||
OPEN_SSL_X86_64_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/${OPEN_SSL_x86_64_DIR_NAME}"
|
||||
OPEN_SSL_ARM_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/${OPEN_SSL_ARM_DIR_NAME}"
|
||||
|
||||
build_openssl_init_common() {
|
||||
DIR=$1
|
||||
# Use 1.1.1s becasue of https://github.com/openssl/openssl/issues/18720
|
||||
OPENSSL_VERSION="1.1.1s"
|
||||
|
||||
echo "============================ OpenSSL ============================"
|
||||
|
||||
cd $EXTERNAL_MACOS_SOURCE_DIR
|
||||
curl -O https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
|
||||
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz
|
||||
rm -rf $DIR
|
||||
rm -rf $OPEN_SSL_DIR_PATH
|
||||
mv openssl-$OPENSSL_VERSION $DIR
|
||||
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz
|
||||
mv openssl-$OPENSSL_VERSION $OPEN_SSL_ARM_DIR_NAME
|
||||
}
|
||||
|
||||
build_openssl_init_arm64() {
|
||||
DIR=$OPEN_SSL_ARM_DIR_PATH
|
||||
build_openssl_init_common ${DIR}
|
||||
}
|
||||
|
||||
build_openssl_init_x86_64() {
|
||||
DIR=$OPEN_SSL_X86_64_DIR_PATH
|
||||
build_openssl_init_common ${DIR}
|
||||
}
|
||||
|
||||
build_openssl_compile_common() {
|
||||
ARCH=$1
|
||||
DIR=""
|
||||
XARCH=""
|
||||
case $ARCH in
|
||||
arm64)
|
||||
DIR=$OPEN_SSL_ARM_DIR_PATH
|
||||
XARCH="darwin64-arm64-cc";;
|
||||
x86_64)
|
||||
DIR=$OPEN_SSL_X86_64_DIR_PATH
|
||||
XARCH="darwin64-x86_64-cc";;
|
||||
esac
|
||||
|
||||
echo "Build OpenSSL for ${ARCH}"
|
||||
cd $DIR
|
||||
./Configure $XARCH
|
||||
make
|
||||
|
||||
}
|
||||
|
||||
build_openssl_compile_arm64() {
|
||||
ARCH=arm64
|
||||
build_openssl_compile_common "${ARCH}"
|
||||
}
|
||||
|
||||
build_openssl_compile_x86_64() {
|
||||
ARCH=x86_64
|
||||
build_openssl_compile_common "${ARCH}"
|
||||
}
|
||||
|
||||
build_openssl_install_common() {
|
||||
DIR=$1
|
||||
mv ${DIR}/include/* $EXTERNAL_MACOS_INCLUDE_DIR
|
||||
mv ${DIR}/libcrypto.a ${EXTERNAL_MACOS_LIB_DIR}/libcrypto.a
|
||||
mv ${DIR}/libssl.a ${EXTERNAL_MACOS_LIB_DIR}/libssl.a
|
||||
}
|
||||
|
||||
build_openssl_install_arm64() {
|
||||
build_openssl_install_common "${OPEN_SSL_ARM_DIR_PATH}"
|
||||
}
|
||||
|
||||
build_openssl_install_x86_64() {
|
||||
build_openssl_install_common "${OPEN_SSL_X86_64_DIR_PATH}"
|
||||
}
|
||||
|
||||
build_openssl_install_universal() {
|
||||
OPEN_SSL_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/${OPEN_SSL_DIR_NAME}"
|
||||
mv ${OPEN_SSL_ARM_DIR_PATH}/include/* $OPEN_SSL_DIR_PATH/include
|
||||
build_openssl_install_common "${OPEN_SSL_DIR_PATH}"
|
||||
}
|
||||
|
||||
build_openssl_arm64() {
|
||||
build_openssl_init_arm64
|
||||
build_openssl_compile_arm64
|
||||
build_openssl_install_arm64
|
||||
}
|
||||
|
||||
build_openssl_x86_64() {
|
||||
build_openssl_init_x86_64
|
||||
build_openssl_compile_x86_64
|
||||
build_openssl_install_x86_64
|
||||
}
|
||||
|
||||
build_openssl_combine() {
|
||||
OPEN_SSL_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/${OPEN_SSL_DIR_NAME}"
|
||||
echo "Create universal bin"
|
||||
mkdir -p $OPEN_SSL_DIR_PATH/include
|
||||
lipo -create ${OPEN_SSL_ARM_DIR_PATH}/libcrypto.a ${OPEN_SSL_X86_64_DIR_PATH}/libcrypto.a -output ${OPEN_SSL_DIR_PATH}/libcrypto.a
|
||||
lipo -create ${OPEN_SSL_ARM_DIR_PATH}/libssl.a ${OPEN_SSL_X86_64_DIR_PATH}/libssl.a -output ${OPEN_SSL_DIR_PATH}/libssl.a
|
||||
}
|
||||
|
||||
build_openssl_universal() {
|
||||
build_openssl_init_arm64
|
||||
build_openssl_compile_arm64
|
||||
build_openssl_init_x86_64
|
||||
build_openssl_compile_x86_64
|
||||
build_openssl_combine
|
||||
build_openssl_install_universal
|
||||
}
|
||||
4
scripts/macos/build_openssl_universal.sh
Executable file
4
scripts/macos/build_openssl_universal.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ./build_openssl_common.sh
|
||||
build_openssl_universal
|
||||
4
scripts/macos/build_openssl_x86_64.sh
Executable file
4
scripts/macos/build_openssl_x86_64.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ./build_openssl_common.sh
|
||||
build_openssl_x86_64
|
||||
@@ -7,20 +7,37 @@ project(flutter_libsparkmobile_library VERSION 0.0.1)
|
||||
|
||||
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
|
||||
|
||||
if(BUILD_FOR_SYSTEM_NAME STREQUAL "macos")
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
|
||||
add_library(flutter_libsparkmobile SHARED
|
||||
"flutter_libsparkmobile.cpp"
|
||||
"utils.cpp"
|
||||
"flutter_libsparkmobile.cpp"
|
||||
"utils.cpp"
|
||||
)
|
||||
|
||||
add_subdirectory(deps/boost-cmake)
|
||||
add_subdirectory("deps/sparkmobile")
|
||||
|
||||
set_target_properties(flutter_libsparkmobile PROPERTIES
|
||||
PUBLIC_HEADER flutter_libsparkmobile.h
|
||||
OUTPUT_NAME "flutter_libsparkmobile"
|
||||
)
|
||||
if(BUILD_FOR_SYSTEM_NAME STREQUAL "macos")
|
||||
set_target_properties(flutter_libsparkmobile PROPERTIES FRAMEWORK TRUE
|
||||
FRAMEWORK_VERSION C
|
||||
MACOSX_FRAMEWORK_IDENTIFIER com.cypherstack.flutter_libsparkmobile
|
||||
# "current version" in semantic format in Mach-O binary file
|
||||
VERSION 16.4.0
|
||||
# "compatibility version" in semantic format in Mach-O binary file
|
||||
SOVERSION 1.0.0
|
||||
PUBLIC_HEADER flutter_libsparkmobile.h
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
|
||||
)
|
||||
target_compile_options(flutter_libsparkmobile PUBLIC -fembed-bitcode)
|
||||
else()
|
||||
set_target_properties(flutter_libsparkmobile PROPERTIES
|
||||
PUBLIC_HEADER flutter_libsparkmobile.h
|
||||
OUTPUT_NAME "flutter_libsparkmobile"
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(flutter_libsparkmobile sparkmobile)
|
||||
|
||||
|
||||
@@ -4,7 +4,11 @@ project(sparkmobile)
|
||||
|
||||
set(OPENSSL_USE_STATIC_LIBS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
SET(OPENSSL_ROOT_DIR "${CMAKE_SOURCE_DIR}/build/${BUILD_FOR_SYSTEM_NAME}/prefix_${ANDROID_ABI}")
|
||||
if(BUILD_FOR_SYSTEM_NAME STREQUAL "macos")
|
||||
SET(OPENSSL_ROOT_DIR "${CMAKE_SOURCE_DIR}/build/${BUILD_FOR_SYSTEM_NAME}")
|
||||
else()
|
||||
SET(OPENSSL_ROOT_DIR "${CMAKE_SOURCE_DIR}/build/${BUILD_FOR_SYSTEM_NAME}/prefix_${ANDROID_ABI}")
|
||||
endif()
|
||||
|
||||
SET(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/include")
|
||||
|
||||
@@ -95,14 +99,16 @@ add_library(sparkmobile SHARED
|
||||
src/util.cpp)
|
||||
|
||||
if(BUILD_FOR_SYSTEM_NAME STREQUAL "android")
|
||||
# target_link_libraries(sparkmobile secp256k1_spark Boost::thread ${log-lib})
|
||||
target_link_libraries(sparkmobile ${OPENSSL_LIBRARIES} secp256k1_spark Boost::thread ${log-lib})
|
||||
# target_link_libraries(sparkmobile ${LIB_SSL} ${LIB_CRYPTO} secp256k1_spark Boost::thread ${log-lib})
|
||||
else()
|
||||
target_link_libraries(sparkmobile ${OPENSSL_LIBRARIES} secp256k1_spark Boost::thread)
|
||||
# target_link_libraries(sparkmobile ${LIB_SSL} ${LIB_CRYPTO} secp256k1_spark Boost::thread)
|
||||
endif()
|
||||
|
||||
add_dependencies(sparkmobile secp256k1_spark)
|
||||
|
||||
target_include_directories(sparkmobile PUBLIC secp256k1_spark ${OPENSSL_INCLUDE_DIR})
|
||||
if(BUILD_FOR_SYSTEM_NAME STREQUAL "macos")
|
||||
target_include_directories(sparkmobile PUBLIC secp256k1_spark ${OPENSSL_INCLUDE_DIR} "${CMAKE_SOURCE_DIR}/deps/missing_headers")
|
||||
else()
|
||||
target_include_directories(sparkmobile PUBLIC secp256k1_spark ${OPENSSL_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user