From e52d4b64862a248e9c6743d42e6bd244c8de2899 Mon Sep 17 00:00:00 2001 From: Emilien Bauer Date: Mon, 31 Oct 2022 10:24:24 +0100 Subject: [PATCH] Remove gen from emitted files to solve circular dependency with build_library=no. Use env variable to pass the output dir instead. Add a CI step to guard regression on this. Clean the generated sources to avoid interfering with next steps. --- .github/workflows/ci.yml | 5 +++++ binding_generator.py | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4665ed94..307b8b02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,6 +105,11 @@ jobs: if: ${{ matrix.platform == 'windows' && matrix.flags == 'use_mingw=yes' }} uses: egor-tensin/setup-mingw@v2 + - name: Generate godot-cpp sources only + run: | + scons platform=${{ matrix.platform }} build_library=no ${{ matrix.flags }} + scons -c + - name: Build godot-cpp (debug) run: | scons platform=${{ matrix.platform }} target=template_debug ${{ matrix.flags }} diff --git a/binding_generator.py b/binding_generator.py index 0bf46ea9..89a20070 100644 --- a/binding_generator.py +++ b/binding_generator.py @@ -141,8 +141,9 @@ def print_file_list(api_filepath, output_dir, headers=False, sources=False): def scons_emit_files(target, source, env): files = [env.File(f) for f in get_file_list(str(source[0]), target[0].abspath, True, True)] - env.Clean(files, target) - return [target[0]] + files, source + env.Clean(target, files) + env["godot_cpp_gen_dir"] = target[0].abspath + return files, source def scons_generate_bindings(target, source, env): @@ -151,7 +152,7 @@ def scons_generate_bindings(target, source, env): env["generate_template_get_node"], "32" if "32" in env["arch"] else "64", "double" if (env["float"] == "64") else "float", - target[0].abspath, + env["godot_cpp_gen_dir"], ) return None