Skip to content

Commit ffdadf2

Browse files
committed
CI: install latest llvm on macos
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
1 parent cb0aa80 commit ffdadf2

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,28 @@ jobs:
240240
- name: Install dependencies
241241
run: |
242242
brew update
243-
brew install valkey
243+
brew install llvm valkey
244244
- name: Build and install using CMake
245245
run: |
246+
# If you need to have llvm first in your PATH, run:
247+
# echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> /Users/runner/.bash_profile
248+
# For compilers to find llvm you may need to set:
249+
# export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
250+
# export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
251+
# For cmake to find llvm you may need to set:
252+
# export CMAKE_PREFIX_PATH="/opt/homebrew/opt/llvm"
253+
254+
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
255+
export CC=/opt/homebrew/opt/llvm/bin/clang
256+
246257
mkdir build && cd build
247258
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_TLS=ON -DENABLE_EXAMPLES=ON
248259
sudo ninja -v install
249260
- name: Build using Makefile
250-
run: USE_TLS=1 make
261+
run: |
262+
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
263+
export CC=/opt/homebrew/opt/llvm/bin/clang
264+
USE_TLS=1 make
251265
- name: Run tests
252266
working-directory: tests
253267
env:

tests/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ if(GLIB_LIBRARY_FOUND)
282282
# From clang-22 and https://github.com/llvm/llvm-project/pull/162662 the
283283
# use of `__COUNTER__` in glib-2.0 causes warnings, e.g. in glib/gmacros.h:1243.
284284
# Disabling the c2y-extensions warning until corrected in GLib.
285-
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND
285+
message(CMAKE_C_COMPILER_ID="${CMAKE_C_COMPILER_ID}")
286+
message(CMAKE_C_COMPILER_VERSION="${CMAKE_C_COMPILER_VERSION}")
287+
if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" AND
286288
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 22)
287289
target_compile_options(ct_async_glib PRIVATE -Wno-c2y-extensions)
288290
endif()

0 commit comments

Comments
 (0)