Skip to content

Commit

Permalink
Use ninja to build faster (drogonframework#1755)
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui authored Aug 28, 2023
1 parent 9337571 commit 8d4c177
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ jobs:

- name: Install dependencies
# Already installed: brotli, zlib, postgresql@14, lz4, sqlite3
run: brew install jsoncpp mariadb hiredis redis
run: brew install ninja jsoncpp mariadb hiredis redis

- name: Create Build Environment & Configure Cmake
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: |
cmake -B build \
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUILD_TESTING=on \
-DBUILD_SHARED_LIBS=OFF
- name: Build
working-directory: ./build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: make -j $(nproc) && sudo make install
run: ninja && sudo ninja install

- name: Prepare for testing
run: |
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
sudo apt update
# These aren't available or don't work well in vcpkg
sudo apt-get install -y libjsoncpp-dev uuid-dev libssl-dev zlib1g-dev libsqlite3-dev
sudo apt-get install -y libbrotli-dev
sudo apt-get install -y ninja-build libbrotli-dev
- name: Install postgresql
run: |
Expand All @@ -154,7 +154,7 @@ jobs:
# We'll use this as our working directory for all subsequent commands
if: matrix.buildname != 'ubuntu-22.04/coroutines'
run: |
cmake -B build \
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUILD_TESTING=on \
-DBUILD_SHARED_LIBS=$shared
Expand All @@ -163,7 +163,7 @@ jobs:
# We'll use this as our working directory for all subsequent commands
if: matrix.buildname == 'ubuntu-22.04/coroutines'
run: |
cmake -B build \
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUILD_TESTING=on \
-DCMAKE_CXX_FLAGS="-fcoroutines" \
Expand All @@ -172,7 +172,7 @@ jobs:
- name: Build
working-directory: ./build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: make -j $(nproc) && sudo make install
run: ninja && sudo ninja install

- name: Prepare for testing
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ jobs:
run: |
sudo apt update
sudo apt-get install -y libjsoncpp-dev uuid-dev libssl-dev zlib1g-dev libsqlite3-dev
sudo apt-get install -y libbrotli-dev
sudo apt-get install -y ninja-build libbrotli-dev
- name: Create Build Environment & Configure Cmake
run: |
cmake -B build \
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUILD_TESTING=on \
-DBUILD_TESTING=on \
-DBUILD_SHARED_LIBS=$SHARED
# Initializes the CodeQL tools for scanning.
Expand All @@ -72,7 +72,7 @@ jobs:

- name: Build
working-directory: ./build
run: make -j $(nproc) && sudo make install
run: ninja && sudo ninja install

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand Down

0 comments on commit 8d4c177

Please sign in to comment.