Automate compiling libgit2

This commit is contained in:
Twarit
2020-03-30 00:38:40 +05:30
parent cc512c0a17
commit 3364a0ef16
7 changed files with 41 additions and 41 deletions

View File

@@ -8,18 +8,18 @@ Implements the proxy end-points for the `EditorVCSInterface` API in the Godot En
## Build Instructions
> Replace `Release` with `Debug` for a debug build.
### Windows
1. Open `build_libs_release.bat` as text.
1. Open `build_libs.bat` as text.
2. Edit the relative paths to the Godot binary and from the Godot binary directory to this repository's directory in line 1 and line 2.
3. Run `build_libs_release.bat`.
4. Run `cd ..` because the build file leaves you one level deeper in the repository.
5. Load the x64 command prompt: `x64 Native Tools Command Prompt for VS 2017`.
6. Run `scons platform=windows target=release`
3. Load the x64 command prompt: `x64 Native Tools Command Prompt for VS 20XX`.
4. Run `build_libs.bat Release`.
5. Run `scons platform=windows target=release`
### Linux
1. Open `build_libs_release.sh` as text.
1. Open `build_libs.sh` as text.
2. Edit the relative paths to the Godot binary and from the Godot binary directory to this repository's directory in line 1 and line 2.
3. Prepare script for execution: `chmod 755 build_libs_release.sh`
4. Run ```. ./build_libs_release.sh```.
5. Run `cd ..` because the build file leaves you one level deeper in the repository.
6. Run `scons platform=x11 target=release`.
3. Prepare script for execution: `chmod 755 build_libs.sh`
4. Run ```. ./build_libs.sh Release```.
5. Run `scons platform=x11 target=release`.

View File

@@ -5,5 +5,17 @@ git submodule update --init --recursive
cd %GODOT_PATH_RELATIVE_TO_PLUGIN%
godot.windows.tools.64.exe --gdnative-generate-json-api api.json
copy api.json %GIT_PLUGIN_RELATIVE_TO_GODOT%\api.json /Y
cd %GIT_PLUGIN_RELATIVE_TO_GODOT%\godot-cpp\
scons platform=windows target=debug generate_bindings=yes use_custom_api_file=yes custom_api_file=../api.json bits=64
cd %GIT_PLUGIN_RELATIVE_TO_GODOT%
cd godot-git-plugin\thirdparty\libgit2\
mkdir build
cd build\
del /F CMakeCache.txt
cmake ..
cmake --build .
cd ../../../../
copy godot-git-plugin\thirdparty\libgit2\build\%1\git2.lib demo\bin\win64\
cd godot-cpp\
scons platform=windows target=%1 generate_bindings=yes bits=64
cd ..

17
build_libs.sh Normal file
View File

@@ -0,0 +1,17 @@
GODOT_PATH_RELATIVE_TO_PLUGIN="../godot/bin";
GIT_PLUGIN_RELATIVE_TO_GODOT="../../godot-git-plugin/";
git submodule init;
git submodule update --init --recursive;
cd godot-git-plugin/thirdparty/libgit2/
mkdir build
cd build/
rm CMakeCache.txt
cmake ..
cmake --build .
cd ../../../../
copy godot-git-plugin/thirdparty/libgit2/build/$1/libgit2.a demo/bin/x11/libgit2.a
cd godot-cpp/;
scons platform=linux target=$1 generate_bindings=yes bits=64;
cd ..

View File

@@ -1,10 +0,0 @@
GODOT_PATH_RELATIVE_TO_PLUGIN="../godot/bin";
GIT_PLUGIN_RELATIVE_TO_GODOT="../../godot-git-plugin/";
git submodule init;
git submodule update --init --recursive;
cd $GODOT_PATH_RELATIVE_TO_PLUGIN;
./godot.x11.tools.64 --gdnative-generate-json-api api.json;
cp api.json $GIT_PLUGIN_RELATIVE_TO_GODOT/api.json;
cd $GIT_PLUGIN_RELATIVE_TO_GODOT;
cd godot-cpp/;
scons platform=linux target=debug generate_bindings=yes use_custom_api_file=yes custom_api_file=../api.json bits=64;

View File

@@ -1,9 +0,0 @@
set GODOT_PATH_RELATIVE_TO_PLUGIN="..\godot\bin"
set GIT_PLUGIN_RELATIVE_TO_GODOT="..\..\godot-git-plugin\"
git submodule init
git submodule update --init --recursive
cd %GODOT_PATH_RELATIVE_TO_PLUGIN%
godot.windows.tools.64.exe --gdnative-generate-json-api api.json
copy api.json %GIT_PLUGIN_RELATIVE_TO_GODOT%\api.json /Y
cd %GIT_PLUGIN_RELATIVE_TO_GODOT%\godot-cpp\
scons platform=windows target=release generate_bindings=yes use_custom_api_file=yes custom_api_file=../api.json bits=64

View File

@@ -1,10 +0,0 @@
GODOT_PATH_RELATIVE_TO_PLUGIN="../godot/bin";
GIT_PLUGIN_RELATIVE_TO_GODOT="../../godot-git-plugin/";
git submodule init;
git submodule update --init --recursive;
cd $GODOT_PATH_RELATIVE_TO_PLUGIN;
./godot.x11.tools.64 --gdnative-generate-json-api api.json;
cp api.json $GIT_PLUGIN_RELATIVE_TO_GODOT/api.json;
cd $GIT_PLUGIN_RELATIVE_TO_GODOT;
cd godot-cpp/;
scons platform=linux target=release generate_bindings=yes use_custom_api_file=yes custom_api_file=../api.json bits=64;

Binary file not shown.