Skip to content

Commit

Permalink
Updated Github actions.
Browse files Browse the repository at this point in the history
Updated Github actions.

Updated Github actions.

Updated Github actions.

Updated Github actions.

Updated Github actions.

Updated Github actions.

Updated Github actions.

Updated Github actions.
  • Loading branch information
5cript committed Oct 10, 2023
1 parent 3133454 commit c9a7504
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
platform: x64

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} -G"Ninja" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DNUI_BUILD_EXAMPLES=off -DCMAKE_CXX_EXTENSIONS=on -DCMAKE_CXX_COMPILER=c++ -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_STANDARD=20
run: cmake -B ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} -G"Ninja" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_EXTENSIONS=on -DCMAKE_CXX_COMPILER=c++ -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_STANDARD=20
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

Expand All @@ -94,7 +94,7 @@ jobs:
run: echo "WSPACE=$(cygpath '${{github.workspace}}')" >> $GITHUB_ENV

- name: Configure CMake
run: cmake -B ${{env.WSPACE}}/build/clang_${{env.BUILD_TYPE}} -G"Ninja" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DNUI_BUILD_EXAMPLES=off -DCMAKE_CXX_EXTENSIONS=on -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_LINKER=lld -DCMAKE_CXX_STANDARD=20
run: cmake -B ${{env.WSPACE}}/build/clang_${{env.BUILD_TYPE}} -G"Ninja" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_EXTENSIONS=on -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_LINKER=lld -DCMAKE_CXX_STANDARD=20

- name: Build
run: cmake --build ${{env.WSPACE}}/build/clang_${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}
Expand All @@ -103,15 +103,32 @@ jobs:
runs-on: macos-13

steps:
- uses: actions/checkout@v3

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

- name: Get Brew Prefix
run: |
echo "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$BREW_PREFIX/lib" >> $GITHUB_ENV
echo "export CPPFLAGS=-I$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 -B ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} -G"Ninja" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DNUI_BUILD_EXAMPLES=off -DCMAKE_CXX_EXTENSIONS=on -DCMAKE_CXX_STANDARD=20
run: >
cmake
-DCMAKE_C_COMPILER=$BREW_PREFIX/opt/llvm@16/bin/clang
-DCMAKE_CXX_COMPILER=$BREW_PREFIX/opt/llvm@16/bin/clang++
-DCMAKE_LINKER=$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="$BREW_PREFIX"
-DCMAKE_CXX_EXTENSIONS=on
-DCMAKE_CXX_STANDARD=20
- name: Build
run: cmake --build ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}
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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ This is a network library that has:
- cryptopp
- libcurl

### MacOS

Dependencies are expected to be installed via brew.
If this does not work for you, please open an issue.

brew install ninja boost cryptopp curl llvm@16

### Windows

Use vcpkg on windows for these dependencies when building with Visual Studio & cmake.
https://vcpkg.io/en/getting-started.html

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 c9a7504

Please sign in to comment.