Skip to content

Commit 67e84c0

Browse files
authored
Merge pull request #1570 from dsnopek/4.2-cherrypicks-7
Cherry-picks for the godot-cpp 4.2 branch - 7th batch
2 parents 1f9a0b7 + 5921734 commit 67e84c0

File tree

14 files changed

+244
-106
lines changed

14 files changed

+244
-106
lines changed

.github/actions/godot-cache/action.yml renamed to .github/actions/godot-cache-restore/action.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Setup Godot build cache
2-
description: Setup Godot build cache.
1+
name: Restore Godot build cache
2+
description: Restore Godot build cache.
33
inputs:
44
cache-name:
55
description: The cache base name (job name by default).
@@ -10,9 +10,8 @@ inputs:
1010
runs:
1111
using: "composite"
1212
steps:
13-
# Upload cache on completion and check it out now
14-
- name: Load .scons_cache directory
15-
uses: actions/cache@v3
13+
- name: Restore .scons_cache directory
14+
uses: actions/cache/restore@v3
1615
with:
1716
path: ${{inputs.scons-cache}}
1817
key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Save Godot build cache
2+
description: Save Godot build cache.
3+
inputs:
4+
cache-name:
5+
description: The cache base name (job name by default).
6+
default: "${{github.job}}"
7+
scons-cache:
8+
description: The SCons cache path.
9+
default: "${{github.workspace}}/.scons-cache/"
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Save SCons cache directory
14+
uses: actions/cache/save@v4
15+
with:
16+
path: ${{inputs.scons-cache}}
17+
key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ jobs:
9999
with:
100100
submodules: recursive
101101

102-
- name: Setup Godot build cache
103-
uses: ./.github/actions/godot-cache
102+
- name: Restore Godot build cache
103+
uses: ./.github/actions/godot-cache-restore
104104
with:
105105
cache-name: ${{ matrix.cache-name }}
106106
continue-on-error: true
@@ -153,6 +153,12 @@ jobs:
153153
cd test
154154
scons platform=${{ matrix.platform }} verbose=yes target=template_release ${{ matrix.flags }}
155155
156+
- name: Save Godot build cache
157+
uses: ./.github/actions/godot-cache-save
158+
with:
159+
cache-name: ${{ matrix.cache-name }}
160+
continue-on-error: true
161+
156162
- name: Download latest Godot artifacts
157163
uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
158164
if: ${{ matrix.run-tests && env.GODOT_TEST_VERSION == 'master' }}

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# GODOT_GDEXTENSION_DIR: Path to the directory containing GDExtension interface header and API JSON file
66
# GODOT_CPP_SYSTEM_HEADERS Mark the header files as SYSTEM. This may be useful to suppress warnings in projects including this one.
77
# GODOT_CPP_WARNING_AS_ERROR Treat any warnings as errors
8+
# GODOT_ENABLE_HOT_RELOAD Build with hot reload support. Defaults to YES for Debug-builds and NO for Release-builds.
89
# GODOT_CUSTOM_API_FILE: Path to a custom GDExtension API JSON file (takes precedence over `gdextension_dir`)
910
# FLOAT_PRECISION: Floating-point precision level ("single", "double")
1011
#
@@ -57,6 +58,13 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "")
5758
set(CMAKE_BUILD_TYPE Debug)
5859
endif()
5960

61+
# Hot reload is enabled by default in Debug-builds
62+
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
63+
option(GODOT_ENABLE_HOT_RELOAD "Build with hot reload support" ON)
64+
else()
65+
option(GODOT_ENABLE_HOT_RELOAD "Build with hot reload support" OFF)
66+
endif()
67+
6068
if(NOT DEFINED BITS)
6169
set(BITS 32)
6270
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -116,6 +124,10 @@ else()
116124
endif()
117125
endif()
118126

127+
if (GODOT_ENABLE_HOT_RELOAD)
128+
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -D HOT_RELOAD_ENABLED")
129+
endif()
130+
119131
# Generate source from the bindings file
120132
find_package(Python3 3.4 REQUIRED) # pathlib should be present
121133
if(GENERATE_TEMPLATE_GET_NODE)

0 commit comments

Comments
 (0)