Skip to content

Commit

Permalink
Updated build script
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriySalnikov committed Aug 23, 2024
1 parent a2c806b commit e689306
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ used_classes.json
.mono/
obj/
bin/
cmake_build_out/*
src/gen/*
src/editor/my_telemetry_modules
addons/debug_draw_3d/libs/~*
Expand Down
10 changes: 9 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from SCons.Script import SConscript
from SCons.Script.SConscript import SConsEnvironment

import SCons, SCons.Script
import os, platform
import sys, os, platform
import lib_utils, lib_utils_external

# Fixing the encoding of the console
Expand Down Expand Up @@ -131,11 +131,19 @@ def apply_patches(target, source, env: SConsEnvironment):
return lib_utils_external.apply_git_patches(env, patches_to_apply, "godot-cpp")


def get_android_toolchain() -> str:
sys.path.insert(0, "godot-cpp/tools")
import android
sys.path.pop(0)
return os.path.join(android.get_android_ndk_root(env), "build/cmake/android.toolchain.cmake")

# Additional build of the projects via CMake
# def build_cmake(target, source, env: SConsEnvironment):
# extra_flags = []
# if env["platform"] in ["macos", "ios"]:
# extra_flags += ["-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64", "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14"]
# if env["platform"] in ["android"]:
# extra_flags += [f"-DCMAKE_TOOLCHAIN_FILE={get_android_toolchain()}"]
# return lib_utils_external.cmake_build_project(env, "project", extra_flags)

env: SConsEnvironment = SConscript("godot-cpp/SConstruct")
Expand Down
2 changes: 1 addition & 1 deletion lib_utils_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def get_cmake_build_dir_name(env: SConsEnvironment) -> str:
if env.get("threads", True) and env["platform"] == "web":
return f"{env["platform"]}_{env["arch"]}_threads"
return f"{env["platform"]}_{env["arch"]}"
return f"cmake_build_out/{env["platform"]}_{env["arch"]}"


# Get a path to the build folder of the cmake library
Expand Down

0 comments on commit e689306

Please sign in to comment.