Skip to content

Commit

Permalink
Merge pull request #216 from XITRIX/main
Browse files Browse the repository at this point in the history
WatchOS support
  • Loading branch information
krzyzanowskim authored Jun 30, 2024
2 parents 5f2ca63 + df416f5 commit d7da298
Show file tree
Hide file tree
Showing 12 changed files with 2,017 additions and 5 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ IPHONEOS_DEPLOYMENT_VERSION=12.0
MACOSX_DEPLOYMENT_TARGET=10.15
XROS_DEPLOYMENT_VERSION=1.0
APPLETVOS_DEPLOYMENT_VERSION=12.0
WATCHOS_DEPLOYMENT_VERSION=8.0

SIGNING_IDENTITY ?= "Apple Distribution: Marcin Krzyzanowski (67RAULRX93)"

Expand Down
1 change: 1 addition & 0 deletions OpenSSL-Universal.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ Pod::Spec.new do |s|
s.osx.deployment_target = "10.15"
s.tvos.deployment_target = "12.0"
s.visionos.deployment_target = "1.0"
s.watchos.deploytment_target = "8.0"
s.vendored_frameworks = "Frameworks/OpenSSL.xcframework"
end
1,544 changes: 1,539 additions & 5 deletions OpenSSL.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7006DD0108CF3B89D56E8312"
BuildableName = "OpenSSL.framework"
BlueprintName = "OpenSSL (watchOS Simulator)"
ReferencedContainer = "container:OpenSSL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7006DD0108CF3B89D56E8312"
BuildableName = "OpenSSL.framework"
BlueprintName = "OpenSSL (watchOS Simulator)"
ReferencedContainer = "container:OpenSSL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7006DD0108CF3B89D56E8312"
BuildableName = "OpenSSL.framework"
BlueprintName = "OpenSSL (watchOS Simulator)"
ReferencedContainer = "container:OpenSSL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1E2EA2BEB7F5586C8CEBA0D2"
BuildableName = "OpenSSL.framework"
BlueprintName = "OpenSSL (watchOS)"
ReferencedContainer = "container:OpenSSL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1E2EA2BEB7F5586C8CEBA0D2"
BuildableName = "OpenSSL.framework"
BlueprintName = "OpenSSL (watchOS)"
ReferencedContainer = "container:OpenSSL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1E2EA2BEB7F5586C8CEBA0D2"
BuildableName = "OpenSSL.framework"
BlueprintName = "OpenSSL (watchOS)"
ReferencedContainer = "container:OpenSSL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ let package = Package(
.iOS(.v12),
.macOS(.v10_15),
.tvOS(.v12),
.watchOS(.v8),
.custom("xros", versionString: "1.0")
],
products: [
Expand Down
84 changes: 84 additions & 0 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,90 @@ let project = Project(
"SKIP_INSTALL": "NO",
"COPY_PHASE_STRIP": "NO",

"DEVELOPMENT_TEAM": developmentTeam,
"CODE_SIGN_IDENTITY": "Apple Distribution",
"CODE_SIGN_STYLE": "Manual"
])
)
),
.target(
name: "OpenSSL (watchOS)",
destinations: [.appleWatch],
product: .framework,
productName: "OpenSSL",
bundleId: "com.github.krzyzanowskim.OpenSSL",
deploymentTargets: .watchOS("8.0"),
infoPlist: .file(path: .relativeToRoot("support/watchos/Info.plist")),
sources: [],
resources: [
"support/PrivacyInfo.xcprivacy"
],
headers: .headers(
public: .list([.glob("watchos/include/OpenSSL/*.h", excluding: "**/asn1_mac.h"), "support/watchos/OpenSSL.h"])
),
dependencies: [
.library(path: .relativeToRoot("watchos/lib/libcrypto.a"), publicHeaders: .relativeToRoot("watchos/include/OpenSSL"), swiftModuleMap: nil, condition: nil),
.library(path: .relativeToRoot("watchos/lib/libssl.a"), publicHeaders: .relativeToRoot("watchos/include/OpenSSL"), swiftModuleMap: nil, condition: nil)
],
settings: .settings(base: SettingsDictionary()
.marketingVersion(marketingVersion)
.currentProjectVersion("1")
.bitcodeEnabled(false)
.otherLinkerFlags([
"-Xlinker -all_load"
])
.merging([
"SUPPORTED_PLATFORMS": "watchos",

"BUILD_LIBRARY_FOR_DISTRIBUTION": "YES",
"APPLICATION_EXTENSION_API_ONLY": "YES",
"DEFINES_MODULE": "YES",

"SKIP_INSTALL": "NO",
"COPY_PHASE_STRIP": "NO",

"DEVELOPMENT_TEAM": developmentTeam,
"CODE_SIGN_IDENTITY": "Apple Distribution",
"CODE_SIGN_STYLE": "Manual"
])
)
),
.target(
name: "OpenSSL (watchOS Simulator)",
destinations: [.appleWatch],
product: .framework,
productName: "OpenSSL",
bundleId: "com.github.krzyzanowskim.OpenSSL",
deploymentTargets: .watchOS("8.0"),
infoPlist: .file(path: .relativeToRoot("support/watchsimulator/Info.plist")),
sources: [],
resources: [
"support/PrivacyInfo.xcprivacy"
],
headers: .headers(
public: .list([.glob("watchsimulator/include/OpenSSL/*.h", excluding: "**/asn1_mac.h"), "support/watchsimulator/OpenSSL.h"])
),
dependencies: [
.library(path: .relativeToRoot("watchsimulator/lib/libcrypto.a"), publicHeaders: .relativeToRoot("watchsimulator/include/OpenSSL"), swiftModuleMap: nil, condition: nil),
.library(path: .relativeToRoot("watchsimulator/lib/libssl.a"), publicHeaders: .relativeToRoot("watchsimulator/include/OpenSSL"), swiftModuleMap: nil, condition: nil)
],
settings: .settings(base: SettingsDictionary()
.marketingVersion(marketingVersion)
.currentProjectVersion("1")
.bitcodeEnabled(false)
.otherLinkerFlags([
"-Xlinker -all_load"
])
.merging([
"SUPPORTED_PLATFORMS": "watchsimulator",

"BUILD_LIBRARY_FOR_DISTRIBUTION": "YES",
"APPLICATION_EXTENSION_API_ONLY": "YES",
"DEFINES_MODULE": "YES",

"SKIP_INSTALL": "NO",
"COPY_PHASE_STRIP": "NO",

"DEVELOPMENT_TEAM": developmentTeam,
"CODE_SIGN_IDENTITY": "Apple Distribution",
"CODE_SIGN_STYLE": "Manual"
Expand Down
87 changes: 87 additions & 0 deletions config/20-apple.conf
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,91 @@ my %targets = ();
perlasm_scheme => "tvos64",
sys_id => "tvOS",
},

## Base settings for watchOS
"watchos-cross-base" => {
template => 1,
cflags => combine('-isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common', sub { defined($ENV{'WATCHOS_DEPLOYMENT_VERSION'}) ? '-mwatchos-version-min=$(WATCHOS_DEPLOYMENT_VERSION)' : '-mwatchos-version-min=2.0'; }),
disable => [ "engine", "async" ],
defines => [ "HAVE_FORK=0" ]
},

## Base settings for watchOS Simulator
"watchos-sim-cross-base" => {
inherit_from => [ "watchos-cross-base" ],
template => 1,
cflags => add( sub { defined($ENV{'WATCHOS_DEPLOYMENT_VERSION'}) ? '-mwatchos-simulator-version-min=$(WATCHOS_DEPLOYMENT_VERSION)' : '-mwatchos-simulator-version-min=2.0'; }),
},

## Apple watchOS simulator
"watchos-sim-cross-x86_64" => {
inherit_from => [ "darwin-common", "watchos-sim-cross-base" ],
CC => "xcrun -sdk appletvsimulator cc",
cflags => add('-arch x86_64'),
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG",
sys_id => "watchOS",
perlasm_scheme => "watchos64",
},

"watchos-sim-cross-i386" => {
inherit_from => [ "darwin-common", "watchos-sim-cross-base" ],
CC => "xcrun -sdk appletvsimulator cc",
cflags => add('-arch i386'),
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "BN_LLONG RC4_INT",
asm_arch => 'x86',
sys_id => "watchos",
},

"watchos-sim-cross-arm64e" => {
inherit_from => [ "darwin-common", "watchos-sim-cross-base" ],
CC => "xcrun -sdk appletvsimulator cc",
cflags => add('-arch arm64e'),
asm_arch => 'aarch64',
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "watchos64",
sys_id => "watchOS",
},

"watchos-sim-cross-arm64" => {
inherit_from => [ "darwin-common", "watchos-sim-cross-base" ],
CC => "xcrun -sdk appletvsimulator cc",
cflags => add('-arch arm64'),
asm_arch => 'aarch64',
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "watchos64",
sys_id => "watchOS",
},

## Apple watchOS
"watchos-cross-arm64" => {
inherit_from => [ "darwin-common", "watchos-cross-base" ],
cflags => add("-arch arm64"),
asm_arch => 'aarch64',
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
lib_cppflags => add("-DL_ENDIAN"),
perlasm_scheme => "watchos64",
sys_id => "watchOS",
},

"watchos-cross-arm64_32" => {
inherit_from => [ "darwin-common", "watchos-cross-base" ],
cflags => add("-arch arm64_32"),
asm_arch => 'aarch64',
bn_ops => "BN_LLONG RC4_INT",
lib_cppflags => add("-DL_ENDIAN"),
perlasm_scheme => "watchos64",
sys_id => "watchOS",
},

"watchos-cross-armv7k" => {
inherit_from => [ "darwin-common", "watchos-cross-base" ],
cflags => add("-arch armv7k"),
asm_arch => 'aarch32',
bn_ops => "BN_LLONG RC4_INT",
sys_id => "watchOS",
},
);
Loading

0 comments on commit d7da298

Please sign in to comment.