Skip to content

Commit

Permalink
Update build script and documentation for version 1.0.0 with single p…
Browse files Browse the repository at this point in the history
…latform target support
  • Loading branch information
jasonacox committed Jan 20, 2025
1 parent 2c284a1 commit 360d634
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This Script builds OpenSSL, nghttp2 and cURL/libcurl for MacOS (x86_64, arm64),

## News

* 19-Jan-2025: Updated build script to allow building for single platform targets: macOS, iOS or tvOS. Specify with `-p macOS`. Default build is for "all" as it has been. Added examples apps for tvOS and macOS.
* 19-Jan-2025: Version 1.0.0 - Updated build script to allow building for single platform targets: macOS, iOS or tvOS. Specify with `-p macOS`. Default build is for "all" as it has been. Added examples apps for tvOS and macOS.
* 17-Mar-2024: Updated tvOS build script to work with XCode 15.3 and added `--without-libpsl` for cURL due to on-by-default policy (see [cURL blog](https://daniel.haxx.se/blog/2024/01/10/psl-in-curl/)). TODO: Get a static build of libpsl for cross-compile.
* 19-Jul-2023: Added OpenSSL 3.0.x (LTS) Support and removed EOL bitcode for builds going forward.
* 13-Feb-2021: Update now builds XCFrameworks which supports all platforms and targets for easy import into your projects.
Expand Down
20 changes: 20 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# RELEASE NOTES

## v1.0.0 - Platform Builds

* Updated build script to allow building for single platform targets: macOS, iOS or tvOS. Specify with `-p <platform>` switch. Default build is for "all" as it has been.
```bash
# Examples

./build.sh -p macos # Build only for macOS
./build.sh -p ios # Build only for iOS
./build.sh -p tvos # Build only for tvOS
./build.sh # Build for all - macOS, iOS and tvOS

# Disable Confirmation (auto-Yes)
./build.sh -y
```

* Added [examples apps](https://github.com/jasonacox/Build-OpenSSL-cURL/tree/master/example) for tvOS and macOS.
<img width="641" alt="Image" src="https://github.com/user-attachments/assets/a05b76b5-2052-4033-be18-fdf45f7342e0" />

6 changes: 5 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ NGHTTP2="1.64.0" # https://nghttp2.org/
BUILD_MACHINE=`uname -m`
BUILD_CMD=$*

# Script Version
SCRIPT_VERSION="1.0.0"

# Compile Cache - Optional
# export CMAKE_CXX_COMPILER_LAUNCHER="ccache"

Expand Down Expand Up @@ -81,6 +84,7 @@ trap 'echo -e "\n${alertdim}Cancelled by User${normal}"; exit 1' INT

# Show Usage
usage () {
echo -e "${bold}Build-OpenSSL-cURL${dim} - v$SCRIPT_VERSION"
echo
echo -e "${bold}Usage:${normal}"
echo
Expand Down Expand Up @@ -158,7 +162,7 @@ shift $((OPTIND-1))
OSARGS="-s ${IOS_MIN_SDK_VERSION} -t ${TVOS_MIN_SDK_VERSION} -i ${MACOS_X86_64_VERSION} -a ${MACOS_ARM64_VERSION}"

## Welcome
echo -e "${bold}Build-OpenSSL-cURL${dim}"
echo -e "${bold}Build-OpenSSL-cURL${dim} - v$SCRIPT_VERSION"
echo
echo -e " - OpenSSL version: ${subbold}${OPENSSL}${dim}"
echo -e " - cURL version: ${subbold}${LIBCURL}${dim}"
Expand Down
50 changes: 50 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Example Apps

These three example Xcode projects show how to incorporate the OpenSSL+Curl libraries into your code.

## iOS

The iOS Build [iOS Test App](./iOS%20Test%20App/)

<img width="400" alt="image" src="https://github.com/jasonacox/Build-OpenSSL-cURL/assets/836718/6de13ab3-b7fe-4017-bf6d-9cbde131c098">
<img width="400" alt="image" src="https://github.com/jasonacox/Build-OpenSSL-cURL/assets/836718/66806f0c-0915-4742-b71c-b683300082ae">

## tvOS

The tvOS Build [tvOS Test App](./tvOS%20Test%20App/)

<img width="641" alt="Image" src="https://github.com/user-attachments/assets/fd0b1e2b-6f2c-4295-853a-574dc8533461" />

## macOS

The macOS Build [macOS Test App](./macOS%20Test%20App/)

<img width="641" alt="Image" src="https://github.com/user-attachments/assets/a05b76b5-2052-4033-be18-fdf45f7342e0" />

## Build Notes

The Test Apps will not build without the required files in the `libs` and `include` folders. These are created during the build and will be installed by the script:

```bash
./build.sh
```

If you are setting up a new Xcode project, there are a few things you will need to do, including adding the required xcframework (lib) files and include path. Note, these are all set up for you already in the Test xcodeproj files.

### Add to Project

You will need to add the xcframework files (libs) and header files (include). You will also need to add libz.tbd to the Xcode project ("General").

<img width="495" alt="Image" src="https://github.com/user-attachments/assets/a1f194e4-2947-48e9-aa57-01458a79f623" />

You will also need to import the `cacert.pem` certificate bundle file into your project if you plan to use HTTPS (openssl) for certificate verification.

### Sandbox Settings for macOS

For macOS builds, you will need to allow "Outgoing Connection (Client)" in the "Signing & Capabilities" of the project target "Sandbox" settings.

<img width="482" alt="Image" src="https://github.com/user-attachments/assets/cd7f5e68-bc3e-4b5c-94d6-cb44c4c2ad23" />

You will also need to add libz.tbd, libldap.tbd, CoreFoundation.framework, and SystemConfiguration.framework to the Xcode project ("General") to prevent build errors.

<img width="482" alt="Image" src="https://github.com/user-attachments/assets/29fd3b15-f130-41cd-91d8-689a6b8b3f50" />

0 comments on commit 360d634

Please sign in to comment.