Skip to content

Commit

Permalink
Merge pull request #135 from AngeloD2022/feat/macos-universal
Browse files Browse the repository at this point in the history
Update minimum CMake version and MacOS architectures
  • Loading branch information
AngeloD2022 authored May 5, 2024
2 parents 7df3d04 + 42a2110 commit e8a796b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 9 deletions.
44 changes: 38 additions & 6 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.25.2'
cmake-version: '3.26'

- name: Configure CMake
run: cmake .
Expand Down Expand Up @@ -46,8 +46,8 @@ jobs:
with:
files: jsxer-${{ github.ref_name }}-Windows.zip

build-macos:
name: Build Release for macOS
build-macos-arm64:
name: Build Release for macOS (arm64)
runs-on: macos-latest

steps:
Expand All @@ -57,7 +57,7 @@ jobs:
- name: Install CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.25.2'
cmake-version: '3.26'

- name: Configure CMake
run: cmake .
Expand All @@ -69,11 +69,43 @@ jobs:
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: ${{ format('jsxer-{0}-macOS.zip', github.ref_name) }}
filename: ${{ format('jsxer-{0}-macOS-arm64.zip', github.ref_name) }}
path: './bin/release/'

- name: Attach Build Artifacts to Release
uses: softprops/action-gh-release@v1
with:
files: jsxer-${{ github.ref_name }}-macOS.zip
files: jsxer-${{ github.ref_name }}-macOS-arm64.zip

build-macos-x86:
name: Build Release for macOS (x86)

# at the time of writing this, you need to have macos-13 in order to build for x86.
runs-on: macos-13

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.26'

- name: Configure CMake
run: cmake .

- name: Build Project
run: cmake --build . --config release

- name: Zip Artifacts
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: ${{ format('jsxer-{0}-macOS-x86.zip', github.ref_name) }}
path: './bin/release/'

- name: Attach Build Artifacts to Release
uses: softprops/action-gh-release@v1
with:
files: jsxer-${{ github.ref_name }}-macOS-x86.zip
6 changes: 4 additions & 2 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:

strategy:
matrix:
os: [macos-latest, windows-latest]
# macos arm64, macos x86_64, and windows
# at the time of writing this, you need to have macos-13 in order to build for x86.
os: [macos-latest, macos-13, windows-latest]

steps:
- name: Checkout code
Expand All @@ -18,7 +20,7 @@ jobs:
- name: Install CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.25.2'
cmake-version: '3.26'

- name: Configure CMake
run: cmake .
Expand Down
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

project(Jsxer)

# using c++17 to use some modern features of c++
Expand Down Expand Up @@ -46,6 +47,15 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)

message("Build: " "${CMAKE_BUILD_TYPE}")

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BUILD_ARCH "64-bit")
else()
set(BUILD_ARCH "32-bit")
endif()

message("System Architecture: " "${CMAKE_SYSTEM_PROCESSOR}")
message("System Bitness: " "${BUILD_ARCH}")

if(MSVC OR MSYS OR MINGW)
# for detecting Windows compilers
set(BUILD_PLATFORM "Windows")
Expand Down

0 comments on commit e8a796b

Please sign in to comment.