Skip to content

Commit

Permalink
Merge pull request x2on#236 from khaitu/master
Browse files Browse the repository at this point in the history
Create XCFramework Modulemap
  • Loading branch information
x2on authored Oct 6, 2023
2 parents d8829c0 + 053fa6a commit eae87b0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
10 changes: 5 additions & 5 deletions OpenSSL-for-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
2A8A9A7D1BFA59F7002944B4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2A8A9A7F1BFA59F7002944B4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2A8A9A841BFA5AFF002944B4 /* ViewController~tv.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "ViewController~tv.xib"; sourceTree = "<group>"; };
533ED2FB1528C4840005C6FA /* OpenSSL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenSSL.app; sourceTree = BUILT_PRODUCTS_DIR; };
533ED2FB1528C4840005C6FA /* OpenSSL-for-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "OpenSSL-for-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
533ED2FF1528C4840005C6FA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
533ED3011528C4840005C6FA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
533ED3031528C4840005C6FA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -128,7 +128,7 @@
533ED2FC1528C4840005C6FA /* Products */ = {
isa = PBXGroup;
children = (
533ED2FB1528C4840005C6FA /* OpenSSL.app */,
533ED2FB1528C4840005C6FA /* OpenSSL-for-iOS.app */,
53572A4B183AAFFE00B21832 /* OpenSSL-for-iOS_Tests.xctest */,
2A8A9A6F1BFA59F7002944B4 /* OpenSSL-for-tvOS.app */,
);
Expand Down Expand Up @@ -235,7 +235,7 @@
);
name = "OpenSSL-for-iOS";
productName = "OpenSSL-for-iOS";
productReference = 533ED2FB1528C4840005C6FA /* OpenSSL.app */;
productReference = 533ED2FB1528C4840005C6FA /* OpenSSL-for-iOS.app */;
productType = "com.apple.product-type.application";
};
53572A4A183AAFFE00B21832 /* OpenSSL-for-iOS_Tests */ = {
Expand Down Expand Up @@ -570,7 +570,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 6.0;
PRODUCT_BUNDLE_IDENTIFIER = "de.felixschulze.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = OpenSSL;
PRODUCT_NAME = "OpenSSL-for-iOS";
SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -591,7 +591,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 6.0;
PRODUCT_BUNDLE_IDENTIFIER = "de.felixschulze.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = OpenSSL;
PRODUCT_NAME = "OpenSSL-for-iOS";
SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 15.0;
Expand Down
1 change: 1 addition & 0 deletions OpenSSL-for-iOS/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import UIKit
import OpenSSL

class ViewController: UIViewController {

Expand Down
19 changes: 19 additions & 0 deletions create-xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ make_include_dir()
fi
}

make_module_map()
{
MODULE_HEADERS=`ls include/openssl 2>/dev/null`
MODULEMAP="xfwinclude/openssl/module.modulemap"
BLACKLISTED="asn1_mac.h"

echo "module OpenSSL {" > $MODULEMAP

for MODULE_HEADER in $MODULE_HEADERS
do
if ! [[ "$BLACKLISTED" =~ .*"$MODULE_HEADER".* ]]; then
echo $MODULE_HEADER | sed -E 's/^.*$/ header \"&\"/' >> $MODULEMAP
fi
done

echo "\n export *\n}" >> $MODULEMAP
}

# Combine libssl and libcrypto into single per-platform library
make_platform_lib()
{
Expand All @@ -55,6 +73,7 @@ remove_temp_files()

remove_temp_files
make_include_dir
make_module_map
PLATFORMS="iOS tvOS watchOS Catalyst"
for PLATFORM in $PLATFORMS
do
Expand Down

0 comments on commit eae87b0

Please sign in to comment.