Skip to content

Commit

Permalink
Switch to toolchain file
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed May 24, 2024
1 parent c8bacbe commit 4ad99e8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ jobs:
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
-DCMAKE_APPLE_SILICON_PROCESSOR=arm64
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j3
Expand Down Expand Up @@ -192,8 +190,6 @@ jobs:
~/wrongbrew.sh fixbin curl
~/wrongbrew.sh bundle install
~/wrongbrew.sh fixbin qt@5
~/wrongbrew.sh fixbin fltk
~/wrongbrew.sh fixbin pkg-config
npm update -g npm
npm install --location=global appdmg
env:
Expand All @@ -208,8 +204,7 @@ jobs:
cmake -S . \
-B build \
-DCMAKE_INSTALL_PREFIX="../target" \
-DCMAKE_PREFIX_PATH=$(~/wrongbrew.sh --prefix qt@5);$(~/wrongbrew.sh --prefix) \
-DCMAKE_FIND_ROOT_PATH=$(~/wrongbrew --prefix)
-DCMAKE_TOOLCHAIN_FILE="../cmake/toolchains/Apple-Arm64.cmake"
$CMAKE_OPTS \
-DUSE_WERROR=OFF
- name: Build
Expand Down
25 changes: 25 additions & 0 deletions cmake/toolchains/Apple-Arm64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
set(WRONGBREW_BIN "$ENV{HOME}/wrongbrew.sh")

execute_process(COMMAND "${WRONGBREW_BIN}" --prefix
RESULT_VARIABLE DETECT_WRONGBREW
OUTPUT_VARIABLE WRONGBREW_PREFIX
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)

execute_process(COMMAND "${WRONGBREW_BIN}" --prefix qt@5
OUTPUT_VARIABLE QT_PREFIX
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)

if(DETECT_WRONGBREW EQUAL 0)
list(APPEND CMAKE_PREFIX_PATH "${WRONGBREW_PREFIX};${QT_PREFIX}")
set(CMAKE_APPLE_SILICON_PROCESSOR arm64)
set(CMAKE_FIND_ROOT_PATH "${WRONGBREW_PREFIX}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
else()
message(FATAL_ERROR "Could not invoke \"${WRONGBREW_BIN}\" --prefix")
endif()

0 comments on commit 4ad99e8

Please sign in to comment.