Skip to content

Commit

Permalink
ci: try to use ninja to speed up build on Linux and macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Jun 13, 2023
1 parent 89fff2b commit 91cb7e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/macos-build.yml
Expand Up @@ -69,6 +69,9 @@ jobs:
share
key: ${{ runner.os }}${{ inputs.build_variant }}-deps-${{ hashFiles('submodule-status') }}

- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3

- name: Build dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: make xcode/deps
Expand Down
1 change: 1 addition & 0 deletions action-install-linux.sh
Expand Up @@ -15,6 +15,7 @@ sudo apt update -y
# https://bugs.launchpad.net/ubuntu/+source/google-glog/+bug/1991919
# https://github.com/kadalu-tech/pkgs/pull/2/files#r1001042597
sudo apt install -y libunwind-dev
sudo apt install -y ninja-build
sudo apt install -y ${dep_packages[@]}
make deps/gtest
make -C deps/opencc build
Expand Down
12 changes: 6 additions & 6 deletions deps.mk
Expand Up @@ -23,7 +23,7 @@ clean-src:

glog:
cd $(src_dir)/glog; \
cmake . -B$(build) \
cmake . -B$(build) -GNinja \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DWITH_GFLAGS:BOOL=OFF \
Expand All @@ -33,15 +33,15 @@ glog:

gtest:
cd $(src_dir)/googletest; \
cmake . -B$(build) \
cmake . -B$(build) -GNinja \
-DBUILD_GMOCK:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install

leveldb:
cd $(src_dir)/leveldb; \
cmake . -B$(build) \
cmake . -B$(build) -GNinja \
-DLEVELDB_BUILD_BENCHMARKS:BOOL=OFF \
-DLEVELDB_BUILD_TESTS:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING="Release" \
Expand All @@ -50,22 +50,22 @@ leveldb:

marisa:
cd $(src_dir)/marisa-trie; \
cmake $(src_dir) -B$(build) \
cmake $(src_dir) -B$(build) -GNinja \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install

opencc:
cd $(src_dir)/opencc; \
cmake . -B$(build) \
cmake . -B$(build) -GNinja \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install

yaml-cpp:
cd $(src_dir)/yaml-cpp; \
cmake . -B$(build) \
cmake . -B$(build) -GNinja \
-DYAML_CPP_BUILD_CONTRIB:BOOL=OFF \
-DYAML_CPP_BUILD_TESTS:BOOL=OFF \
-DYAML_CPP_BUILD_TOOLS:BOOL=OFF \
Expand Down

0 comments on commit 91cb7e3

Please sign in to comment.