Skip to content

Commit

Permalink
Updated Github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
5cript committed Oct 10, 2023
1 parent 120a946 commit b9db8b4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,26 @@ jobs:

- run: brew install ninja boost cryptopp curl llvm@16

- name: Get Brew Prefix
run: |
echo "export BREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
- name: Set Env Vars
run: |
echo "export LDFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV
echo "export CPPFLAGS=-I/opt/homebrew/include" >> $GITHUB_ENV
echo "export LDFLAGS=-L${{env.BREW_PREFIX}}/lib" >> $GITHUB_ENV
echo "export CPPFLAGS=-I${{env.BREW_PREFIX}}/include" >> $GITHUB_ENV
- name: Configure CMake
run: >
cmake
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@16/bin/clang
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@16/bin/clang++
-DCMAKE_LINKER=/opt/homebrew/opt/llvm@16/bin/lld
-DCMAKE_C_COMPILER=${{env.BREW_PREFIX}}/opt/llvm@16/bin/clang
-DCMAKE_CXX_COMPILER=${{env.BREW_PREFIX}}/opt/llvm@16/bin/clang++
-DCMAKE_LINKER=${{env.BREW_PREFIX}}/opt/llvm@16/bin/lld
-S ${{github.workspace}}
-B ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}}
-G"Ninja"
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DBREW_PREFIX="${{env.BREW_PREFIX}}"
-DNUI_BUILD_EXAMPLES=off
-DCMAKE_CXX_EXTENSIONS=on
-DCMAKE_CXX_STANDARD=20
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ endif()
include(./cmake/warnings.cmake)
include(./cmake/example_target.cmake)
include(./cmake/options.cmake)
include(./cmake/brew.cmake)

# Deps
include(./cmake/dependencies/boost.cmake)
Expand Down
1 change: 1 addition & 0 deletions cmake/brew.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(BREW_PREFIX "/opt/homebrew" CACHE STRING "Homebrew install prefix")
4 changes: 2 additions & 2 deletions cmake/dependencies/cryptopp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if (WIN32)
target_link_libraries(roar-cryptopp INTERFACE cryptopp-static)
endif()
elseif(APPLE)
find_library(CRYPTOPP_LIB libcryptopp.a HINTS /opt/homebrew/lib)
target_include_directories(roar-cryptopp INTERFACE /opt/homebrew/include)
find_library(CRYPTOPP_LIB libcryptopp.a HINTS ${BREW_PREFIX}/lib)
target_include_directories(roar-cryptopp INTERFACE ${BREW_PREFIX}/include)
target_link_libraries(roar-cryptopp INTERFACE ${CRYPTOPP_LIB})
elseif(UNIX)
pkg_check_modules(cryptopp IMPORTED_TARGET libcrypto++)
Expand Down

0 comments on commit b9db8b4

Please sign in to comment.