From 259d15ff6b76ae82f2becd89ae0dca2a112be239 Mon Sep 17 00:00:00 2001 From: Sungun Park Date: Mon, 18 May 2026 18:13:08 -0700 Subject: [PATCH 1/2] Make release split build as default `-y release` now becomes the default option for ./build.sh. Fix a conflict with clean options (-c or -C) as split build will always be executed for clean options otherwise. Fix web build as it hasn't wired up with split build yet. --- CMakeLists.txt | 14 ++++++-------- build.sh | 22 +++++++++++++--------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5475ef545ca..cc79183bb370 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -834,16 +834,14 @@ if (FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR) set(IMPORT_EXECUTABLES_DIR ${FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR}) endif() -if (WASM) - set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-Release.cmake) +if (FILAMENT_EXPORT_PREBUILT_EXECUTABLES OR FILAMENT_IMPORT_PREBUILT_EXECUTABLES) + set(IMPORT_EXECUTABLES_BUILD_TYPE Prebuilt) +elseif (WASM) + set(IMPORT_EXECUTABLES_BUILD_TYPE Release) else() - if (FILAMENT_EXPORT_PREBUILT_EXECUTABLES OR FILAMENT_IMPORT_PREBUILT_EXECUTABLES) - set(IMPORT_EXECUTABLES_BUILD_TYPE Prebuilt) - else() - set(IMPORT_EXECUTABLES_BUILD_TYPE ${CMAKE_BUILD_TYPE}) - endif() - set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-${IMPORT_EXECUTABLES_BUILD_TYPE}.cmake) + set(IMPORT_EXECUTABLES_BUILD_TYPE ${CMAKE_BUILD_TYPE}) endif() +set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-${IMPORT_EXECUTABLES_BUILD_TYPE}.cmake) # ================================================================================================== # Common Functions diff --git a/build.sh b/build.sh index 39757e0696f9..20fb4a39ec55 100755 --- a/build.sh +++ b/build.sh @@ -83,6 +83,7 @@ function print_help { echo " Build the filament dependent tools (matc, resgen) separately from the project. This will set" echo " the tools as prebuilts that filament target will then use to build. The built_type option" echo " (debug|release) is meant to indicate the type of build of the resulting prebuilts." + echo " Defaults to 'release' (tools are always prebuilt as release unless overridden)." echo "" echo "Build types:" echo " release" @@ -223,8 +224,8 @@ OSMESA_OPTION="" IOS_BUILD_SIMULATOR=false BUILD_UNIVERSAL_LIBRARIES=false -ISSUE_SPLIT_BUILD=false -SPLIT_BUILD_TYPE="" +ISSUE_SPLIT_BUILD=true +SPLIT_BUILD_TYPE="release" PREBUILT_TOOLS_DIR="" IMPORT_EXECUTABLES_DIR_OPTION="-DIMPORT_EXECUTABLES_DIR=out" @@ -1132,13 +1133,6 @@ done validate_build_command -if [[ "${ISSUE_SPLIT_BUILD}" == "true" ]]; then - # Capitalize first letter of SPLIT_BUILD_TYPE - SPLIT_BUILD_TYPE_CAPITALIZED="$(echo ${SPLIT_BUILD_TYPE:0:1} | tr '[:lower:]' '[:upper:]')${SPLIT_BUILD_TYPE:1}" - build_tools_for_split_build "${SPLIT_BUILD_TYPE_CAPITALIZED}" - IMPORT_EXECUTABLES_DIR_OPTION="-DFILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR=${PREBUILT_TOOLS_DIR}" -fi - if [[ "${ISSUE_CLEAN}" == "true" ]]; then build_clean fi @@ -1147,6 +1141,16 @@ if [[ "${ISSUE_CLEAN_AGGRESSIVE}" == "true" ]]; then build_clean_aggressive fi +# Only runs the split build for tools if an actual debug or release build is requested. +# This prevents the split build from being triggered when a clean (-c or -C) is requested. +if [[ "${ISSUE_SPLIT_BUILD}" == "true" ]] && \ + [[ "${ISSUE_DEBUG_BUILD}" == "true" || "${ISSUE_RELEASE_BUILD}" == "true" ]]; then + # Capitalize first letter of SPLIT_BUILD_TYPE + SPLIT_BUILD_TYPE_CAPITALIZED="$(echo ${SPLIT_BUILD_TYPE:0:1} | tr '[:lower:]' '[:upper:]')${SPLIT_BUILD_TYPE:1}" + build_tools_for_split_build "${SPLIT_BUILD_TYPE_CAPITALIZED}" + IMPORT_EXECUTABLES_DIR_OPTION="-DFILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR=${PREBUILT_TOOLS_DIR}" +fi + if [[ "${ISSUE_DESKTOP_BUILD}" == "true" ]]; then check_debug_release_build build_desktop fi From d349c9cd7d4a8a7e991e1f279b5af022887b1248 Mon Sep 17 00:00:00 2001 From: Sungun Park Date: Tue, 19 May 2026 11:33:12 -0700 Subject: [PATCH 2/2] add none option --- build.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 20fb4a39ec55..7a72c77a29f7 100755 --- a/build.sh +++ b/build.sh @@ -81,8 +81,9 @@ function print_help { echo " Enable perfetto traces on Android. Disabled by default on the Release build, enabled otherwise." echo " -y build_type" echo " Build the filament dependent tools (matc, resgen) separately from the project. This will set" - echo " the tools as prebuilts that filament target will then use to build. The built_type option" - echo " (debug|release) is meant to indicate the type of build of the resulting prebuilts." + echo " the tools as prebuilts that filament target will then use to build. The build_type option" + echo " (debug|release|none) is meant to indicate the type of build of the resulting prebuilts," + echo " or 'none' to disable the split build." echo " Defaults to 'release' (tools are always prebuilt as release unless overridden)." echo "" echo "Build types:" @@ -1086,14 +1087,17 @@ while getopts ":hacCfgimp:q:uvWslwedtk:bVx:S:X:Py:E" opt; do X) OSMESA_OPTION="-DFILAMENT_OSMESA_PATH=${OPTARG}" ;; y) - ISSUE_SPLIT_BUILD=true SPLIT_BUILD_TYPE=${OPTARG} case $(echo "${SPLIT_BUILD_TYPE}" | tr '[:upper:]' '[:lower:]') in debug|release) + ISSUE_SPLIT_BUILD=true + ;; + none) + ISSUE_SPLIT_BUILD=false ;; *) echo "Unknown build type for -y: ${SPLIT_BUILD_TYPE}" - echo "Build type must be one of [debug|release]" + echo "Build type must be one of [debug|release|none]" echo "" exit 1 ;;