diff options
| author | lhchavez <[email protected]> | 2020-02-23 13:53:17 +0000 |
|---|---|---|
| committer | lhchavez <[email protected]> | 2020-02-23 13:53:17 +0000 |
| commit | c20008416a64e2ae884a14332b258160a261a5df (patch) | |
| tree | 58ae95d9f007937876eed1aac89b0518a034e442 /script | |
| parent | 79fe156d307a9c7b294aa92c741dc0c2759a1894 (diff) | |
| parent | 4bca045e5aa98b0b791fb467705de0692fe3514f (diff) | |
Merge remote-tracking branch 'upstream/master' into git_index_add_frombuffer
Diffstat (limited to 'script')
| -rwxr-xr-x | script/build-libgit2-dynamic.sh | 5 | ||||
| -rwxr-xr-x | script/build-libgit2-static.sh | 18 | ||||
| -rwxr-xr-x | script/build-libgit2.sh | 46 |
3 files changed, 53 insertions, 16 deletions
diff --git a/script/build-libgit2-dynamic.sh b/script/build-libgit2-dynamic.sh new file mode 100755 index 0000000..af037f3 --- /dev/null +++ b/script/build-libgit2-dynamic.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +exec "$(dirname "$0")/build-libgit2.sh" --dynamic diff --git a/script/build-libgit2-static.sh b/script/build-libgit2-static.sh index 5723721..1d28898 100755 --- a/script/build-libgit2-static.sh +++ b/script/build-libgit2-static.sh @@ -1,19 +1,5 @@ #!/bin/sh -set -ex +set -e -VENDORED_PATH=vendor/libgit2 - -cd $VENDORED_PATH && -mkdir -p install/lib && -mkdir -p build && -cd build && -cmake -DTHREADSAFE=ON \ - -DBUILD_CLAR=OFF \ - -DBUILD_SHARED_LIBS=OFF \ - -DCMAKE_C_FLAGS=-fPIC \ - -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DCMAKE_INSTALL_PREFIX=../install \ - .. && - -cmake --build . +exec "$(dirname "$0")/build-libgit2.sh" --static diff --git a/script/build-libgit2.sh b/script/build-libgit2.sh new file mode 100755 index 0000000..acbc84a --- /dev/null +++ b/script/build-libgit2.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# Since CMake cannot build the static and dynamic libraries in the same +# directory, this script helps build both static and dynamic versions of it and +# have the common flags in one place instead of split between two places. + +set -e + +if [ "$#" -eq "0" ]; then + echo "Usage: $0 <--dynamic|--static>">&2 + exit 1 +fi + +ROOT="$(cd "$(dirname "$0")/.." && echo "${PWD}")" +VENDORED_PATH="${ROOT}/vendor/libgit2" + +case "$1" in + --static) + BUILD_PATH="${ROOT}/static-build" + BUILD_SHARED_LIBS=OFF + ;; + + --dynamic) + BUILD_PATH="${ROOT}/dynamic-build" + BUILD_SHARED_LIBS=ON + ;; + + *) + echo "Usage: $0 <--dynamic|--static>">&2 + exit 1 + ;; +esac + +mkdir -p "${BUILD_PATH}/build" "${BUILD_PATH}/install/lib" + +cd "${BUILD_PATH}/build" && +cmake -DTHREADSAFE=ON \ + -DBUILD_CLAR=OFF \ + -DBUILD_SHARED_LIBS"=${BUILD_SHARED_LIBS}" \ + -DREGEX_BACKEND=builtin \ + -DCMAKE_C_FLAGS=-fPIC \ + -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ + -DCMAKE_INSTALL_PREFIX="${BUILD_PATH}/install" \ + "${VENDORED_PATH}" && + +exec cmake --build . --target install |
