Skip to content

Commit 5cec5bb

Browse files
authored
Merge pull request #2019 from Faless/build/scons_profile_rebuild
SCons: Only rebuild gen files when build profile changes
2 parents ba0edfe + b800bd3 commit 5cec5bb

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎tools/godotcpp.py‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,17 @@ def scons_emit_files(target, source, env):
137137
profile_filepath = env.get("build_profile", "")
138138
if profile_filepath:
139139
profile_filepath = normalize_path(profile_filepath, env)
140+
source += [profile_filepath] # Add to sources so we rebuild if it changes.
140141

141142
# Always clean all files
142143
env.Clean(target, [env.File(f) for f in get_file_list(str(source[0]), target[0].abspath, True, True)])
143144

144145
api = generate_trimmed_api(str(source[0]), profile_filepath)
145146
files = []
146147
for f in _get_file_list(api, target[0].abspath, True, True):
147-
file = env.File(f)
148-
if profile_filepath:
149-
env.Depends(file, profile_filepath)
150-
files.append(file)
151-
env["godot_cpp_gen_dir"] = target[0].abspath
148+
files.append(env.File(f))
152149

150+
env["godot_cpp_gen_dir"] = target[0].abspath
153151
# gdextension_interface.h shouldn't depend on extension_api.json or the build_profile.json.
154152
gdextension_interface_header = os.path.join(str(target[0]), "gen", "include", "gdextension_interface.h")
155153
env.Ignore(gdextension_interface_header, [source[0], profile_filepath])

0 commit comments

Comments
 (0)