summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-06-07 19:00:05 +0200
committerCarlos Martín Nieto <[email protected]>2014-06-07 19:12:33 +0200
commita2b14b5be4bf70650f6ec4a7a1ebab7c0a993c81 (patch)
treea72c1fb13425f465405927270a1797005a2e699b
parent12a3a1e05c03fdc9767ef62e5ff9e0d677946525 (diff)
Tighten up the build
Build as release, and there is no need to install the library, we know where the files are.
-rwxr-xr-xscript/build-libgit2-static.sh10
-rwxr-xr-xscript/with-static.sh10
2 files changed, 10 insertions, 10 deletions
diff --git a/script/build-libgit2-static.sh b/script/build-libgit2-static.sh
index ca5390d..b4d4241 100755
--- a/script/build-libgit2-static.sh
+++ b/script/build-libgit2-static.sh
@@ -4,13 +4,15 @@ set -ex
VENDORED_PATH=vendor/libgit2
-cd $VENDORED_PATH
-
+cd $VENDORED_PATH &&
+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 \
- .
+ .. &&
-make install
+cmake --build .
diff --git a/script/with-static.sh b/script/with-static.sh
index 643dcff..0caed5e 100755
--- a/script/with-static.sh
+++ b/script/with-static.sh
@@ -2,12 +2,10 @@
set -ex
-export INSTALL_LOCATION=$PWD/vendor/install
-export PKG_CONFIG_PATH=$INSTALL_LOCATION/lib/pkgconfig
+export BUILD="$PWD/vendor/libgit2/build"
+export PCFILE="$BUILD/libgit2.pc"
-export PCFILE="$PWD/vendor/libgit2/libgit2.pc"
-
-export CGO_LDFLAGS="$PWD/vendor/libgit2/libgit2.a $(pkg-config --static --libs $PCFILE)"
-export CGO_CFLAGS="$(pkg-config --static --cflags $PCFILE)"
+export CGO_LDFLAGS="$BUILD/libgit2.a -L$BUILD $(pkg-config --static --libs $PCFILE)"
+export CGO_CFLAGS="-I$PWD/vendor/libgit2/include"
$@