Skip to content

Commit 28aacf5

Browse files
authored
Merge pull request #102 from contour-terminal/fix/macOS-build
Fix SIMD scanning on macOS (using std::simd)
2 parents 346b7e7 + 708cf19 commit 28aacf5

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,36 @@ jobs:
5757
- name: "test"
5858
run: ./build/src/libunicode/unicode_test
5959

60+
# {{{ macOS
61+
osx:
62+
name: "macOS"
63+
runs-on: macos-14
64+
steps:
65+
- uses: actions/checkout@v4
66+
- name: ccache
67+
uses: hendrikmuhs/ccache-action@v1.2
68+
with:
69+
key: ccache-osx_qt${{ steps.set_vars.outputs.QTVER }}-r1
70+
max-size: 256M
71+
- name: "Install dependencies"
72+
# Sometimes, brew thinks it needs to install from source rather than binary.
73+
# For Qt this may take ages (many many hours). Let's not waste our CPU credits here,
74+
# and limit the run time.
75+
timeout-minutes: 15
76+
run: |
77+
set -ex
78+
#brew update
79+
./scripts/install-deps.sh
80+
- name: "Create build directory"
81+
run: mkdir build
82+
- name: "Generate build files"
83+
run: cmake --preset macos-release
84+
- name: "Build"
85+
run: cmake --build --preset macos-release
86+
- name: "Test"
87+
run: ctest --preset macos-release
88+
# }}}
89+
6090
windows:
6191
name: "Windows"
6292
runs-on: windows-latest

scripts/install-deps.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ install_deps_darwin()
194194
# catch2: available in brew, but too new (version 3+)
195195
brew install $SYSDEP_ASSUME_YES \
196196
fmt \
197+
ninja \
197198
pkg-config \
198199
range-v3
199200
}

src/libunicode/scan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <string_view>
2424

2525
// clang-format off
26-
#if __has_include(<experimental/simd>) && defined(LIBUNICODE_USE_STD_SIMD)
26+
#if __has_include(<experimental/simd>) && defined(LIBUNICODE_USE_STD_SIMD) && !defined(__APPLE__)
2727
#define USE_STD_SIMD
2828
#include <experimental/simd>
2929
namespace stdx = std::experimental;

0 commit comments

Comments
 (0)