-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improving compiling for mac * Add install libgit script
- Loading branch information
1 parent
6555324
commit d377fd7
Showing
5 changed files
with
67 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
git clone --depth 1 --branch v0.25.0 git://github.com/libgit2/libgit2 libgit2 | ||
|
||
cd libgit2 | ||
# Those files are temporary, should not be in git. To minimize | ||
# impact, we'll delete them now | ||
rm -rf CMakeCache.txt CMakeFiles | ||
|
||
# There is no official way to specify a generator | ||
# inside CMakeLists.txt, see | ||
# https://stackoverflow.com/questions/11269833/cmake-selecting-a-generator-within-cmakelists-txt | ||
# So we deriving the environment from uname and setting generator | ||
# in the command line, | ||
# https://stackoverflow.com/questions/3466166/how-to-check-if-running-in-cygwin-mac-or-linux | ||
unameOut="$(uname -s)" | ||
case "${unameOut}" in | ||
Linux*) machine=Linux;; | ||
Darwin*) machine=Mac;; | ||
CYGWIN*) machine=Cygwin;; | ||
MINGW*) machine=MinGw;; | ||
*) machine="UNKNOWN:${unameOut}" | ||
esac | ||
|
||
# Passing an argument with a space is a trouble, so we switch from sh to bash | ||
# https://stackoverflow.com/a/2249967/9469533 | ||
EXTRA_ARGS=( ) | ||
if [[ $machine == MinGw ]] | ||
then | ||
extra_args=( -G "MSYS Makefiles" ) | ||
fi | ||
|
||
cmake -DTHREADSAFE=ON -DBUILD_CLAR=OFF -DCMAKE_INSTALL_PREFIX=$PWD/install "${extra_args[@]}" . | ||
|
||
cmake --build . | ||
|
||
cmake --build . --target install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters