Skip to content

Commit

Permalink
Initial macOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
IgKh committed Sep 3, 2024
1 parent f5e04be commit e8dfa36
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,42 @@ jobs:
- name: Run tests
run: ctest --output-on-failure --test-dir build

build-macos:
runs-on: macos-latest

steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.5.*
cache: true

- name: Install dependencies
run: |
brew install googletest hunspell libarchive
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: 'build'
cache-targets: 'false'
workspaces: |
typstdriver/rust
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug

- name: Build
run: cmake --build build -j

- name: Run tests
run: ctest --output-on-failure --test-dir build

analyse:
runs-on: ubuntu-latest
Expand Down
16 changes: 16 additions & 0 deletions typstdriver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
find_package(Qt6 REQUIRED COMPONENTS Gui Network)

if(APPLE)
find_program(HOMEBREW_EXECUTABLE brew)
if(HOMEBREW_EXECUTABLE)
execute_process(
COMMAND ${HOMEBREW_EXECUTABLE} --prefix libarchive
OUTPUT_VARIABLE _LibArchive_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if(_LibArchive_PREFIX)
message(STATUS "LibArchive found as Homebrew keg at ${_LibArchive_PREFIX}")
set(LibArchive_INCLUDE_DIR "${_LibArchive_PREFIX}/include")
endif()
endif()
endif()
find_package(LibArchive REQUIRED)

find_package(Corrosion QUIET)
Expand Down

0 comments on commit e8dfa36

Please sign in to comment.