Skip to content

Commit

Permalink
Install ninja build tool on CI
Browse files Browse the repository at this point in the history
Fix install prefix

Use developer command prompt on Windows
  • Loading branch information
ClausKlein committed Dec 1, 2024
1 parent 3d0fdf5 commit bf27e93
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Install LCov
run: sudo apt-get update -q
&& sudo apt-get install lcov -q -y
&& sudo apt-get install ninja-build lcov -q -y

- name: Configure
working-directory: asio
Expand Down Expand Up @@ -83,6 +83,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup ninja build toolchain
uses: aminya/setup-cpp@v1
with:
ninja: true

- name: Configure
working-directory: asio
run: cmake --preset=ci-sanitize
Expand Down Expand Up @@ -115,10 +120,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup ninja build toolchain
uses: aminya/setup-cpp@v1
with:
ninja: true

- name: Install static analyzers
if: matrix.os == 'ubuntu-24.04'
run: |
sudo apt-get install cppcheck ninja-build -y -q
# Not used! sudo apt-get install cppcheck -y -q
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19 all
Expand All @@ -134,6 +144,18 @@ jobs:
echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"' >> /Users/runner/.envrc
echo 'export CPPFLAGS="-L/opt/homebrew/opt/llvm/include"' >> /Users/runner/.envrc
# see https://github.com/mathstuf/cxx-modules-sandbox/blob/master/.github/workflows/cmake.yml
- name: Visual Studio toolchain environment
uses: TheMrMilchmann/setup-msvc-dev@v1
with:
arch: x64

# # see https://github.com/marketplace/actions/enable-developer-command-prompt
# - uses: ilammy/msvc-dev-cmd@v1
# if: matrix.os == 'windows-2022'
# with:
# vsversion: 2022

- name: Configure windows
if: matrix.os == 'windows-2022'
working-directory: asio
Expand All @@ -160,15 +182,15 @@ jobs:

- name: Build
working-directory: asio
run: cmake --build build --config Release -j 4
run: cmake --build build --config Debug -j 4

- name: Install
working-directory: asio
run: cmake --install build --config Release --prefix prefix
run: cmake --install build --config Debug # see CMakePresets.json! --prefix stagedir

- name: Test
working-directory: asio/build
run: ctest --output-on-failure --no-tests=error -C Release -j 4
run: ctest --output-on-failure --no-tests=error -C Debug -j 4

docs:
# Deploy docs only when builds succeed
Expand Down Expand Up @@ -198,7 +220,7 @@ jobs:
with: {python-version: "3.12"}

- name: Install m.css dependencies
run: pip3 install jinja2 Pygments
run: pip3 install ninja jinja2 Pygments

- name: Install Doxygen
run: sudo apt-get update -q
Expand Down
1 change: 1 addition & 0 deletions asio/.cmakefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# git ls-files '::*.md' '::*.cmake' '::*CMakeLists.txt' '::*.json' '::*.cmake.in'
#
files='
../.github/workflows/cmake.yml
.CMakeUserPresets.json
.TODO.txt
.clang-format
Expand Down
1 change: 1 addition & 0 deletions asio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ endif()
# ---- Install rules ----

if(NOT CMAKE_SKIP_INSTALL_RULES)
include(cmake/AddUninstallTarget.cmake)
include(cmake/install-rules.cmake)
configure_file(asio.pc.cmake asio.pc)
install(FILES ${PROJECT_BINARY_DIR}/asio.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
Expand Down
1 change: 0 additions & 1 deletion asio/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
"ci-std"
],
"generator": "Ninja",
"architecture": "x64",
"hidden": true
},
{
Expand Down

0 comments on commit bf27e93

Please sign in to comment.