@@ -135,21 +135,6 @@ __rv_env_shell() {
135135 fi
136136}
137137
138- # VARIABLES
139- RV_HOME=" ${RV_HOME:- $SCRIPT_HOME } "
140- RV_BUILD_PARALLELISM=" ${RV_BUILD_PARALLELISM:- $(python3 -c ' import os; print(os.cpu_count())' )} "
141-
142-
143- # Capture current build type before any variable declarations
144- INIT_BUILD_TYPE=" $RV_BUILD_TYPE "
145-
146- # Build configuration variables (initialized by rvrelease at end of script)
147- RV_BUILD_TYPE=" "
148- RV_BUILD_DIR=" "
149- RV_INST_DIR=" "
150- RV_APP_DIR=" "
151- RV_PATH_SUFFIX=" "
152-
153138# Update all path variables based on current RV_PATH_SUFFIX
154139__rv_update_paths () {
155140 RV_BUILD_DIR=" ${RV_HOME} /_build${RV_PATH_SUFFIX} "
@@ -160,31 +145,6 @@ __rv_update_paths() {
160145 fi
161146}
162147
163- # Deactivate virtual environment if active when sourcing
164- if [ -n " $VIRTUAL_ENV " ]; then
165- deactivate
166- fi
167-
168- # Capture clean prompt before any RV modifications (only if not already set)
169- if [ -z " $RV_CLEAN_PROMPT " ]; then
170- RV_CLEAN_PROMPT=" $PS1 "
171- fi
172-
173- # Single set of aliases using current build variables
174- # Note: Single quotes preserve variables for expansion at execution time
175- alias rvenv=' __rv_env_shell'
176- alias rvsetup=' rvenv && SETUPTOOLS_USE_DISTUTILS=${SETUPTOOLS_USE_DISTUTILS} python3 -m pip install --upgrade -r ${RV_HOME}/requirements.txt'
177- alias rvcfg=' rvenv && cmake -B ${RV_BUILD_DIR} -G "${CMAKE_GENERATOR}" ${RV_TOOLCHAIN} ${CMAKE_WIN_ARCH} -DCMAKE_BUILD_TYPE=${RV_BUILD_TYPE} -D${RV_DEPS_QT_LOCATION}=${QT_HOME} -DRV_VFX_PLATFORM=${RV_VFX_PLATFORM} -DRV_DEPS_WIN_PERL_ROOT=${WIN_PERL}'
178- alias rvbuildt=' rvenv && cmake --build ${RV_BUILD_DIR} --config ${RV_BUILD_TYPE} -v --parallel=${RV_BUILD_PARALLELISM} --target '
179- alias rvbuild=' rvenv && rvbuildt main_executable'
180- alias rvtest=' rvenv && ctest --test-dir ${RV_BUILD_DIR} --extra-verbose'
181- alias rvinst=' rvenv && cmake --install ${RV_BUILD_DIR} --prefix ${RV_INST_DIR} --config ${RV_BUILD_TYPE}'
182- alias rvclean=' __rv_clean_build'
183- alias rvappdir=' cd ${RV_APP_DIR}'
184- alias rvhomedir=' cd ${RV_HOME}'
185- alias rvhome=' cd ${RV_HOME}'
186- alias rvmk=' rvcfg && rvbuild'
187- alias rvbootstrap=' rvsetup && rvmk'
188148
189149# Set initial prompt when not in virtual environment
190150__rv_set_first_prompt () {
@@ -258,6 +218,48 @@ rvrelease() {
258218 __rv_switch_config
259219}
260220
221+
222+ # VARIABLES
223+ RV_HOME=" ${RV_HOME:- $SCRIPT_HOME } "
224+ RV_BUILD_PARALLELISM=" ${RV_BUILD_PARALLELISM:- $(python3 -c ' import os; print(os.cpu_count())' )} "
225+
226+ # Capture current build type before any variable declarations
227+ INIT_BUILD_TYPE=" $RV_BUILD_TYPE "
228+
229+ # Build configuration variables (initialized by rvrelease at end of script)
230+ RV_BUILD_TYPE=" "
231+ RV_BUILD_DIR=" "
232+ RV_INST_DIR=" "
233+ RV_APP_DIR=" "
234+ RV_PATH_SUFFIX=" "
235+
236+
237+ # Deactivate virtual environment if active when sourcing
238+ if [ -n " $VIRTUAL_ENV " ]; then
239+ deactivate
240+ fi
241+
242+ # Capture clean prompt before any RV modifications (only if not already set)
243+ if [ -z " $RV_CLEAN_PROMPT " ]; then
244+ RV_CLEAN_PROMPT=" $PS1 "
245+ fi
246+
247+ # Single set of aliases using current build variables
248+ # Note: Single quotes preserve variables for expansion at execution time
249+ alias rvenv=' __rv_env_shell'
250+ alias rvsetup=' rvenv && SETUPTOOLS_USE_DISTUTILS=${SETUPTOOLS_USE_DISTUTILS} python3 -m pip install --upgrade -r ${RV_HOME}/requirements.txt'
251+ alias rvcfg=' rvenv && cmake -B ${RV_BUILD_DIR} -G "${CMAKE_GENERATOR}" ${RV_TOOLCHAIN} ${CMAKE_WIN_ARCH} -DCMAKE_BUILD_TYPE=${RV_BUILD_TYPE} -D${RV_DEPS_QT_LOCATION}=${QT_HOME} -DRV_VFX_PLATFORM=${RV_VFX_PLATFORM} -DRV_DEPS_WIN_PERL_ROOT=${WIN_PERL}'
252+ alias rvbuildt=' rvenv && cmake --build ${RV_BUILD_DIR} --config ${RV_BUILD_TYPE} -v --parallel=${RV_BUILD_PARALLELISM} --target '
253+ alias rvbuild=' rvenv && rvbuildt main_executable'
254+ alias rvtest=' rvenv && ctest --test-dir ${RV_BUILD_DIR} --extra-verbose'
255+ alias rvinst=' rvenv && cmake --install ${RV_BUILD_DIR} --prefix ${RV_INST_DIR} --config ${RV_BUILD_TYPE}'
256+ alias rvclean=' __rv_clean_build'
257+ alias rvappdir=' cd ${RV_APP_DIR}'
258+ alias rvhomedir=' cd ${RV_HOME}'
259+ alias rvhome=' cd ${RV_HOME}'
260+ alias rvmk=' rvcfg && rvbuild'
261+ alias rvbootstrap=' rvsetup && rvmk'
262+
261263echo " Please ensure you have installed any required dependencies from doc/build_system/config_[os]"
262264echo
263265echo " CMake parameters:"
@@ -272,11 +274,10 @@ if [[ "$OSTYPE" == "msys"* || "$OSTYPE" == "cygwin"* ]]; then echo "WIN_PERL is
272274
273275echo " To override any of them do unset [name]; export [name]=value; source $SCRIPT "
274276echo
275- echo
276277echo " Use 'rvrelease' (default) or 'rvdebug' to switch between build configurations."
277- echo " Call 'rvbootstrap' if its your first time building or after calling rvclean."
278278echo
279- echo " After rvbootstrap, you can do incremental builds using 'rvbuild' or 'rvmk'."
279+ echo " Call 'rvbootstrap' if its your first time building or after calling rvclean."
280+ echo " After 'rvbootstrap', use 'rvbuild' or 'rvmk' for incremental builds."
280281echo
281282
282283# Initialize with appropriate build mode (after sourcing, if we were in debug, stay in debug)
0 commit comments