forked from reqshark/nodenng
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile
More file actions
21 lines (19 loc) · 824 Bytes
/
compile
File metadata and controls
21 lines (19 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
if [ ! -d nng ]; then
rm -rf deps nng build && mkdir deps
LATEST_TAG=$(curl --silent "https://api.github.com/repos/nanomsg/nng/releases/latest" | jq -r .tag_name)
git clone --depth 1 https://github.com/nanomsg/nng --branch "$LATEST_TAG" --single-branch && cd nng
else
cd nng
git pull
git submodule update --init --recursive
fi
# macos
# see: https://developer.apple.com/forums/thread/122762?answerId=382261022#382261022
if [[ "$OSTYPE" == "darwin"* ]];
then
export CFLAGS="-isysroot '$(xcrun --show-sdk-path)' $CFLAGS"
fi
mkdir -p build && cd build
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_MESSAGE=NEVER -DCMAKE_INSTALL_PREFIX=$(pwd)/../../deps .. -DNNG_TESTS=OFF -DNNG_TOOLS=OFF -DNNG_ENABLE_NNGCAT=OFF -DNNG_ENABLE_COVERAGE=OFF
make MACOSX_DEPLOYMENT_TARGET=10.15 all install