Skip to content

Commit 259d15f

Browse files
committed
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.
1 parent 1e6c7ee commit 259d15f

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -834,16 +834,14 @@ if (FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR)
834834
set(IMPORT_EXECUTABLES_DIR ${FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR})
835835
endif()
836836

837-
if (WASM)
838-
set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-Release.cmake)
837+
if (FILAMENT_EXPORT_PREBUILT_EXECUTABLES OR FILAMENT_IMPORT_PREBUILT_EXECUTABLES)
838+
set(IMPORT_EXECUTABLES_BUILD_TYPE Prebuilt)
839+
elseif (WASM)
840+
set(IMPORT_EXECUTABLES_BUILD_TYPE Release)
839841
else()
840-
if (FILAMENT_EXPORT_PREBUILT_EXECUTABLES OR FILAMENT_IMPORT_PREBUILT_EXECUTABLES)
841-
set(IMPORT_EXECUTABLES_BUILD_TYPE Prebuilt)
842-
else()
843-
set(IMPORT_EXECUTABLES_BUILD_TYPE ${CMAKE_BUILD_TYPE})
844-
endif()
845-
set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-${IMPORT_EXECUTABLES_BUILD_TYPE}.cmake)
842+
set(IMPORT_EXECUTABLES_BUILD_TYPE ${CMAKE_BUILD_TYPE})
846843
endif()
844+
set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-${IMPORT_EXECUTABLES_BUILD_TYPE}.cmake)
847845

848846
# ==================================================================================================
849847
# Common Functions

build.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ function print_help {
8383
echo " Build the filament dependent tools (matc, resgen) separately from the project. This will set"
8484
echo " the tools as prebuilts that filament target will then use to build. The built_type option"
8585
echo " (debug|release) is meant to indicate the type of build of the resulting prebuilts."
86+
echo " Defaults to 'release' (tools are always prebuilt as release unless overridden)."
8687
echo ""
8788
echo "Build types:"
8889
echo " release"
@@ -223,8 +224,8 @@ OSMESA_OPTION=""
223224
IOS_BUILD_SIMULATOR=false
224225
BUILD_UNIVERSAL_LIBRARIES=false
225226

226-
ISSUE_SPLIT_BUILD=false
227-
SPLIT_BUILD_TYPE=""
227+
ISSUE_SPLIT_BUILD=true
228+
SPLIT_BUILD_TYPE="release"
228229
PREBUILT_TOOLS_DIR=""
229230
IMPORT_EXECUTABLES_DIR_OPTION="-DIMPORT_EXECUTABLES_DIR=out"
230231

@@ -1132,13 +1133,6 @@ done
11321133

11331134
validate_build_command
11341135

1135-
if [[ "${ISSUE_SPLIT_BUILD}" == "true" ]]; then
1136-
# Capitalize first letter of SPLIT_BUILD_TYPE
1137-
SPLIT_BUILD_TYPE_CAPITALIZED="$(echo ${SPLIT_BUILD_TYPE:0:1} | tr '[:lower:]' '[:upper:]')${SPLIT_BUILD_TYPE:1}"
1138-
build_tools_for_split_build "${SPLIT_BUILD_TYPE_CAPITALIZED}"
1139-
IMPORT_EXECUTABLES_DIR_OPTION="-DFILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR=${PREBUILT_TOOLS_DIR}"
1140-
fi
1141-
11421136
if [[ "${ISSUE_CLEAN}" == "true" ]]; then
11431137
build_clean
11441138
fi
@@ -1147,6 +1141,16 @@ if [[ "${ISSUE_CLEAN_AGGRESSIVE}" == "true" ]]; then
11471141
build_clean_aggressive
11481142
fi
11491143

1144+
# Only runs the split build for tools if an actual debug or release build is requested.
1145+
# This prevents the split build from being triggered when a clean (-c or -C) is requested.
1146+
if [[ "${ISSUE_SPLIT_BUILD}" == "true" ]] && \
1147+
[[ "${ISSUE_DEBUG_BUILD}" == "true" || "${ISSUE_RELEASE_BUILD}" == "true" ]]; then
1148+
# Capitalize first letter of SPLIT_BUILD_TYPE
1149+
SPLIT_BUILD_TYPE_CAPITALIZED="$(echo ${SPLIT_BUILD_TYPE:0:1} | tr '[:lower:]' '[:upper:]')${SPLIT_BUILD_TYPE:1}"
1150+
build_tools_for_split_build "${SPLIT_BUILD_TYPE_CAPITALIZED}"
1151+
IMPORT_EXECUTABLES_DIR_OPTION="-DFILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR=${PREBUILT_TOOLS_DIR}"
1152+
fi
1153+
11501154
if [[ "${ISSUE_DESKTOP_BUILD}" == "true" ]]; then
11511155
check_debug_release_build build_desktop
11521156
fi

0 commit comments

Comments
 (0)