diff --git a/CMakeLists.txt b/CMakeLists.txt index c81581fe0f..efcc866195 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,10 @@ endfunction() # Add the projects first so the Launcher can find them include(cmake/Projects.cmake) +if(LY_EXTERNAL_SUBDIRS) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${LY_EXTERNAL_SUBDIRS}) +endif() + if(NOT INSTALLED_ENGINE) # Add external subdirectories listed in the engine.json. LY_EXTERNAL_SUBDIRS is a cache variable so the user can add extra # external subdirectories. This should go before adding the rest of the targets so the targets are availbe to the launcher. diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index 46130f1345..e42664c107 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -445,9 +445,10 @@ function(ly_setup_cmake_install) ) endforeach() - # Transform the LY_EXTERNAL_SUBDIRS list into a json array + # Transform the LY_EXTERNAL_SUBDIRS global property list into a json array set(indent " ") - foreach(external_subdir ${LY_EXTERNAL_SUBDIRS}) + get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + foreach(external_subdir ${external_subdirs}) cmake_path(RELATIVE_PATH external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE engine_rel_external_subdir) list(APPEND relative_external_subdirs "\"${engine_rel_external_subdir}\"") endforeach() @@ -639,7 +640,8 @@ function(ly_setup_assets) # the install layout from the root directory. Such as /Cache. # This is also done to avoid globbing thousands of files in subdirectories that shouldn't # be processed. - foreach(gem_candidate_dir IN LISTS LY_EXTERNAL_SUBDIRS LY_PROJECTS) + get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + foreach(gem_candidate_dir IN LISTS external_subdirs LY_PROJECTS) file(REAL_PATH ${gem_candidate_dir} gem_candidate_dir BASE_DIRECTORY ${LY_ROOT_FOLDER}) # Don't recurse immediately in order to exclude transient source artifacts file(GLOB diff --git a/scripts/build/Platform/Windows/build_windows.cmd b/scripts/build/Platform/Windows/build_windows.cmd index 798550370f..c77c262692 100644 --- a/scripts/build/Platform/Windows/build_windows.cmd +++ b/scripts/build/Platform/Windows/build_windows.cmd @@ -9,6 +9,7 @@ REM SETLOCAL EnableDelayedExpansion CALL "%~dp0env_windows.cmd" +IF NOT %ERRORLEVEL%==0 EXIT /b 1 IF NOT EXIST "%OUTPUT_DIRECTORY%" ( MKDIR %OUTPUT_DIRECTORY%. @@ -21,7 +22,7 @@ ECHO [ci_build] cmake --version cmake --version IF ERRORLEVEL 1 ( ECHO [ci_build] CMAKE not found! - exit /b 1 + EXIT /b 1 ) REM Compute half the amount of processors so some jobs can run @@ -47,14 +48,14 @@ IF NOT EXIST CMakeCache.txt ( ) ) IF DEFINED RUN_CONFIGURE ( - ECHO [ci_build] %CONFIGURE_CMD% - %CONFIGURE_CMD% + call ECHO [ci_build] %CONFIGURE_CMD% + call %CONFIGURE_CMD% IF NOT !ERRORLEVEL!==0 GOTO :error ECHO !CONFIGURE_CMD!> %LAST_CONFIGURE_CMD_FILE% ) -ECHO [ci_build] cmake --build . --target %CMAKE_TARGET% --config %CONFIGURATION% %CMAKE_BUILD_ARGS% -- %CMAKE_NATIVE_BUILD_ARGS% -cmake --build . --target %CMAKE_TARGET% --config %CONFIGURATION% %CMAKE_BUILD_ARGS% -- %CMAKE_NATIVE_BUILD_ARGS% +call ECHO [ci_build] cmake --build . --target %CMAKE_TARGET% --config %CONFIGURATION% %CMAKE_BUILD_ARGS% -- %CMAKE_NATIVE_BUILD_ARGS% +call cmake --build . --target %CMAKE_TARGET% --config %CONFIGURATION% %CMAKE_BUILD_ARGS% -- %CMAKE_NATIVE_BUILD_ARGS% IF NOT %ERRORLEVEL%==0 GOTO :error POPD diff --git a/scripts/build/Platform/Windows/env_windows.cmd b/scripts/build/Platform/Windows/env_windows.cmd index 78b5ca6c1a..c6f46ef575 100644 --- a/scripts/build/Platform/Windows/env_windows.cmd +++ b/scripts/build/Platform/Windows/env_windows.cmd @@ -13,17 +13,21 @@ SETLOCAL EnableExtensions EnableDelayedExpansion where /Q cmake IF NOT %ERRORLEVEL%==0 ( ECHO [ci_build] CMake not found - GOTO :error -) - -IF NOT "%COMMAND_CWD%"=="" ( - ECHO [ci_build] Changing CWD to %COMMAND_CWD% - CD %COMMAND_CWD% + GOTO :errorlocal ) REM Ending the local environment to be able to propagate the TMP/TEMP variables to the calling script ENDLOCAL +IF NOT "%COMMAND_CWD%"=="" ( + call ECHO [ci_build] Changing CWD to %COMMAND_CWD% + call CD %COMMAND_CWD% + IF ERRORLEVEL 1 ( + ECHO [ci_build] Failed to change directory to %COMMAND_CWD% + GOTO :error + ) +) + REM Jenkins does not defined TMP IF "%TMP%"=="" ( IF "%WORKSPACE%"=="" ( @@ -41,6 +45,7 @@ IF "%TMP%"=="" ( EXIT /b 0 -:error +:errorlocal ENDLOCAL +:error EXIT /b 1 \ No newline at end of file