Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriySalnikov committed Aug 5, 2024
1 parent 19650f4 commit bce55ba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
4 changes: 3 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def apply_patches(target, source, env: SConsEnvironment):
# Additional build of the projects via CMake
# def build_cmake(target, source, env: SConsEnvironment):
# extra_flags = []
# return lib_utils_external.cmake_build_project(env, "opus", extra_flags)
# if env["platform"] in ["macos", "ios"]:
# extra_flags += ["-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64", "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14"]
# return lib_utils_external.cmake_build_project(env, "project", extra_flags)

env: SConsEnvironment = SConscript("godot-cpp/SConstruct")
env = env.Clone()
Expand Down
25 changes: 20 additions & 5 deletions docs/Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ As well as for the engine itself, you will need to configure the [environment](h
And also you may need to apply several patches:

```python
# To apply all patches automatically, you can call a single command:
scons apply_patches

## Or apply each patch individually following the instructions below:

cd godot-cpp
# Optional
# #Build only the necessary classes
git apply --ignore-space-change --ignore-whitespace ../patches/godot_cpp_exclude_unused_classes.patch
# Optional
# #Faster builds and larger binaries
git apply --ignore-space-change --ignore-whitespace ../patches/unity_build.patch
# #Hide useless function exports. Can greatly reduce the size of libraries
git apply --ignore-space-change --ignore-whitespace ../patches/visibilty_hidden.patch
# #Add build support With or Without thread support in the browser
git apply --ignore-space-change --ignore-whitespace ../patches/web_threads.patch
```

Then you can just run scons as usual:
Expand All @@ -20,10 +26,19 @@ Then you can just run scons as usual:
# build for the current system.
# target=editor is used for both the editor and the debug template.
scons target=editor dev_build=yes debug_symbols=yes
# Android build. ANDROID_NDK_ROOT is required in your environment variables.

## Android builds
# ANDROID_NDK_ROOT is required in your environment variables.
# Or ANDROID_HOME with 'ndk/23.2.8568313' installed.
scons platform=android target=template_release arch=arm64v8
# Web build. GDExtension for Web currently works best with Emscripten '3.1.39'
# If you have a different version of NDK installed and both ANDROID_HOME
# and ANDROID_NDK_ROOT have been added to the environment variables,
# then you will have to explicitly specify ANDROID_HOME=""
scons platform=android target=template_release arch=arm64v8 ANDROID_HOME=""

## Web build
# GDExtension for Web currently works best with Emscripten '3.1.63'.
# Add threads=[yes|no] depending on the version of Godot and the export flags.
scons platform=web target=template_debug
```

Expand All @@ -35,4 +50,4 @@ If you too want to add an [Interactive Demo](https://dd3d.dmitriysalnikov.ru/dem

In short, you need to activate `Extension Support` when exporting and add the [gzuidhof/coi-serviceworker](https://github.com/gzuidhof/coi-serviceworker) to the \<head\> and to the export folder. Then you will need to somehow publish a demo on the GitHub pages, as for example done in [#24](https://github.com/DmitriySalnikov/godot_debug_draw_3d/pull/24/files#diff-46a620e221376649fe75b0aaf2f607fee47f0d47db1d37bc08bb4a5f11b1af98).

![](images/export_web_for_github.png)
![export_web_for_github](images/export_web_for_github.png)

0 comments on commit bce55ba

Please sign in to comment.