Skip to content

Commit

Permalink
Merge pull request godotengine#15 from lawnjelly/fix_scu_build
Browse files Browse the repository at this point in the history
Fix SCU build for CI
  • Loading branch information
lawnjelly authored Mar 31, 2023
2 parents 140bdf1 + ffa39ab commit d556345
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 5 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/linux_dev_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
env:
# Only used for the cache key. Increment version to force clean build.
GODOT_BASE_BRANCH: 3.x
SCONSFLAGS: verbose=yes warnings=all werror=yes
SCONSFLAGS: verbose=no warnings=all werror=yes

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-linux
Expand All @@ -26,7 +26,7 @@ jobs:
sconsflags: use_scu=yes rids=tracked_handles
bin: "./bin/godot.x11.tools.64"
build-mono: false
artifact: true
artifact: false

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -56,11 +56,17 @@ jobs:
- name: Setup GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master

- name: Copy custom.py
shell: bash
run: |
# Use custom.py to only compile core.
cp -f misc/scripts/custom.py custom.py
- name: Compilation
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: linuxbsd
platform: x11
target: ${{ matrix.target }}
tools: ${{ matrix.tools }}

Expand Down
48 changes: 48 additions & 0 deletions misc/scripts/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# custom.py

module_arkit_enabled = "no"
module_assimp_enabled = "no"
module_bmp_enabled = "no"
module_bullet_enabled = "no"
module_camera_enabled = "no"
module_csg_enabled = "no"
module_cvtt_enabled = "no"
module_dds_enabled = "no"
module_denoise_enabled = "no"
module_enet_enabled = "no"
module_etc_enabled = "no"
module_fbx_enabled = "no"
# module_freetype_enabled = "no"
module_gdnative_enabled = "no"
module_gltf_enabled = "no"
module_gridmap_enabled = "no"
module_hdr_enabled = "no"
module_jpg_enabled = "no"
module_jsonrpc_enabled = "no"
module_lightmapper_cpu_enabled = "no"
module_mbedtls_enabled = "no"
module_minimp3_enabled = "no"
module_mobile_vr_enabled = "no"
module_navigation_enabled = "no"
module_ogg_enabled = "no"
module_opensimplex_enabled = "no"
module_opus_enabled = "no"
module_pvr_enabled = "no"
module_raycast_enabled = "no"
module_regex_enabled = "no"
module_squish_enabled = "no"
modules_std_vorbis_enabled = "no"
# module_svg_enabled = "no"
module_tga_enabled = "no"
module_theora_enabled = "no"
module_tinyexr_enabled = "no"
module_upnp_enabled = "no"
module_vhacd_enabled = "no"
module_visual_script_enabled = "no"
module_vorbis_enabled = "no"
module_webm_enabled = "no"
module_webp_enabled = "yes"
module_webrtc_enabled = "no"
module_websocket_enabled = "no"
module_webxr_enabled = "no"
module_xatlas_unwrap_enabled = "no"
11 changes: 9 additions & 2 deletions scu_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def find_section_name(sub_folder):
folder = os.path.basename(folder)
if folder == "godot":
break
if folder == "godot-plus":
break
folders += [folder]
section_path += "../"
section_path = os.path.abspath(section_path) + "/"
Expand Down Expand Up @@ -189,6 +191,11 @@ def process_folder(folders, sought_exceptions=[], num_output_files=1, extension=

# calculate how many lines to write in each file
total_lines = len(found_includes)

# error condition
if total_lines == 0:
return

lines_per_file = math.floor(total_lines / num_output_files)
lines_per_file = max(lines_per_file, 1)

Expand Down Expand Up @@ -238,8 +245,8 @@ def generate_scu_files(verbose):
curr_folder = os.path.abspath("./")
parent_path = basename(normpath(curr_folder))

if parent_path != "godot":
print("ERROR - scu_builders.py must be run from the godot folder.")
if (parent_path != "godot") and (parent_path != "godot-plus"):
print('ERROR - parent_path is not "godot", ensure scu_builders.py is run from the godot folder.')
return

process_folder(["core"])
Expand Down

0 comments on commit d556345

Please sign in to comment.