Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
fixed the build
  • Loading branch information
DmitriySalnikov committed Aug 6, 2024
1 parent 19650f4 commit e064143
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
13 changes: 8 additions & 5 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ def setup_defines_and_flags(env: SConsEnvironment, src_out):
env.Append(CPPDEFINES=["DISABLE_DEBUG_RENDERING"])

if env["telemetry_enabled"]:
tele_src = "src/editor/my_telemetry_modules/GDExtension/usage_time_reporter.cpp"
if os.path.exists(tele_src):
tele_src = "editor/my_telemetry_modules/GDExtension/usage_time_reporter.cpp"
if os.path.exists(os.path.join(src_folder, tele_src)):
env.Append(CPPDEFINES=["TELEMETRY_ENABLED"])
src_out.append(tele_src)
print("Compiling with telemetry support!")
else:
print("No telemetry source file found. telemetry_enabled will be ignored!")
print("No telemetry source file found.")
env.Exit(1)

if env["lto"]:
if env.get("is_msvc", False):
Expand All @@ -80,7 +81,7 @@ def setup_defines_and_flags(env: SConsEnvironment, src_out):

if env["tracy_enabled"]:
env.Append(CPPDEFINES=["TRACY_ENABLE", "TRACY_ON_DEMAND", "TRACY_DELAYED_INIT", "TRACY_MANUAL_LIFETIME"])
src_out.append("src/thirdparty/tracy/public/TracyClient.cpp")
src_out.append("thirdparty/tracy/public/TracyClient.cpp")

if env.get("is_msvc", False):
env.Append(LINKFLAGS=["/WX:NO"])
Expand Down Expand Up @@ -133,7 +134,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)
1 change: 0 additions & 1 deletion examples_dd3d/DebugDrawDemoScene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,3 @@ func _update_timers(delta : float):
timer_cubes -= delta
timer_3 -= delta
timer_text -= delta

0 comments on commit e064143

Please sign in to comment.