Skip to content

Commit d069789

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

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
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:

examples/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ if(PkgConfig_FOUND)
4141
pkg_check_modules(GLIB2 IMPORTED_TARGET glib-2.0)
4242
if(GLIB2_FOUND)
4343
add_executable(example-async-glib async-glib.c)
44+
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND
45+
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 22)
46+
target_compile_options(example-async-glib PRIVATE -Wno-c2y-extensions)
47+
endif()
4448
target_link_libraries(example-async-glib valkey::valkey PkgConfig::GLIB2)
4549
endif()
4650
endif()

0 commit comments

Comments
 (0)