Skip to content

Commit

Permalink
Merge pull request #254 from qzhuyan/build/william/Ninja
Browse files Browse the repository at this point in the history
build: use ninja if possbile
  • Loading branch information
qzhuyan authored Jan 11, 2024
2 parents 746d7d4 + 61edf8a commit 44e4a8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
erl_crash.dump
.concrete/DEV_MODE
.DS_Store
.cache

# rebar 2.x
.rebar
Expand Down
14 changes: 11 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,23 @@ PKGNAME="$(./pkgname.sh)"
build() {
# default: 4 concurrent jobs
JOBS=4
# if Ninja is installed, use it
if command -v ninja; then
GENERATOR=Ninja
MakeCmd=ninja
else
GENERATOR="Unix Makefiles"
MakeCmd=make
fi
if [ "$(uname -s)" = 'Darwin' ]; then
JOBS="$(sysctl -n hw.ncpu)"
else
JOBS="$(nproc)"
fi
./get-msquic.sh "$MSQUIC_VERSION"
cmake -B c_build
make -j "$JOBS" -C c_build
make install -C c_build
cmake -B c_build -G "${GENERATOR}"
$MakeCmd -C c_build -j "$JOBS"
$MakeCmd -C c_build install
## MacOS
if [ -f priv/libquicer_nif.dylib ]; then
# https://developer.apple.com/forums/thread/696460
Expand Down

0 comments on commit 44e4a8b

Please sign in to comment.