|
root / base / msgpack-c / build.sh
build.sh Bash 29 lines 1.1 KB
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# Build script for msgpack-c (CMake, Ninja generator). CMake doesn't
# recognize Hammerhead and won't set UNIX=TRUE / pick the right shared-lib
# conventions without a Platform module (same gotcha as base/neovim's and
# base/libjpeg-turbo's cmake builds) - map it to the SunOS platform module.
#
# This is the C-only "c-<ver>" release tag (NOT the C++ "cpp-" tag), so
# there is no MSGPACK_ENABLE_CXX option to disable here.
set -e
cd "$SRCDIR"

mkdir -p "$SRCDIR/.cmake/Platform"
echo 'include(Platform/SunOS)' > "$SRCDIR/.cmake/Platform/Hammerhead.cmake"

export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH"

cmake -B build -G Ninja \
    -DCMAKE_MODULE_PATH="$SRCDIR/.cmake" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX="$PREFIX" \
    -DCMAKE_INSTALL_RPATH="$PREFIX/lib" \
    -DCMAKE_C_FLAGS="-D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS" \
    -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
    -DMSGPACK_BUILD_TESTS=OFF \
    -DMSGPACK_BUILD_EXAMPLES=OFF

cmake --build build -j${JOBS:-1}
DESTDIR="$PKGDIR" cmake --install build