diff --git a/SConstruct b/SConstruct index e36b2d4..ac779f9 100644 --- a/SConstruct +++ b/SConstruct @@ -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() diff --git a/docs/Build.md b/docs/Build.md index 966bc06..3afe79a 100644 --- a/docs/Build.md +++ b/docs/Build.md @@ -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: @@ -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 ``` @@ -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 \ 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)