2019-12-02 22:34:04 +00:00
# Build
Before build and launch client, we need build godot-cpp (lib to connect c++ code to godot engine) and build crypt (c++ module use to authentification with khaganat)
2020-01-24 18:56:51 +00:00
## Build module
```
mkdir build
cd build
# Disable build directory on godot editor
touch .gdignore
# clone godot
git clone https://github.com/godotengine/godot.git
cd godot
# switch on release
git checkout 3.1.2-stable
# Create link with our module (or copy file to godot/modules - as you like)
cd modules
for file in ../../../modules/*
do
if [ -d $file ]
then
echo "$file"
ln -s $file .
fi
done
cd ..
# Copy modules doc to godot
cp modules/*/doc_classes/* doc/classes/.
# Clean project (if you build before)
scons -j$(nproc) -c
# Build
scons -j$(nproc) platform=x11
cd ../..
```
### Generate doc
If you want, you can regenerate doc.
(Normally it's generated)
```
cd build/godot
./bin/godot.x11.tools.64 --doctool .
cp modules/*/doc_classes/* doc/classes/.
```
### Launch godot with module
```
cd build/godot
bin/godot.x11.tools.64
cd ../..
```
2019-12-02 22:34:04 +00:00
## Build godot-cpp
### Initialize
Load git submodule (godot-cpp & godot_header)
```
git submodule update --init --recursive
```
### Build on 64bits
```
godot --gdnative-generate-json-api godot-cpp/godot_headers/api.json
scons -C godot-cpp platform=linux generate_bindings=yes custom_api_file=godot_headers/api.json bits=64
```
### Build on 32bits
```
godot --gdnative-generate-json-api godot-cpp/godot_headers/api.json
scons -C godot-cpp platform=linux generate_bindings=yes custom_api_file=godot_headers/api.json bits=32
```
2019-12-10 20:40:32 +00:00
## Build gdnative (crypt / bitstream / bitset)
2019-12-02 22:34:04 +00:00
### Build on 64bits
```
2020-01-19 19:13:57 +00:00
scons -C gdnative platform=linux bits=64 target=debug
scons -C gdnative platform=linux bits=64 target=release
2019-12-02 22:34:04 +00:00
```
### Build on 32bits
```
2020-01-19 19:13:57 +00:00
scons -C gdnative platform=linux bits=32 target=debug
scons -C gdnative platform=linux bits=64 target=release
2019-12-02 22:34:04 +00:00
```
2019-12-10 20:40:32 +00:00
## Package client khaganat
2019-12-02 22:34:04 +00:00
2019-12-10 20:40:32 +00:00
### Configure export
Configure on project export (or edit file export_presets.cfg)
Ex.: export_presets.cfg
```
[preset.0]
2019-12-11 21:27:49 +00:00
name="khaganat.linux.64"
2019-12-10 20:40:32 +00:00
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
[preset.0.options]
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
custom_template/release=""
custom_template/debug=""
```
### Generate package
```
2019-12-11 21:27:49 +00:00
godot --path . --export khaganat.linux.64 khaganat.linux64.bin
2019-12-10 20:40:32 +00:00
```
2019-12-02 22:34:04 +00:00
## Launch client khaganat
2019-12-02 22:51:50 +00:00
### With godot
```
godot login_scene/login_scene.tsc
```