@echo off\r
\r
-:: This is needed so as to avoid static expansion of environment variables\r
-:: inside if (...) conditionals.\r
-:: See http://stackoverflow.com/questions/305605/weird-scope-issue-in-bat-file\r
-:: for more explanation.\r
-:: Precisely needed for configuring Visual Studio Environment.\r
+REM This is needed so as to avoid static expansion of environment variables\r
+REM inside if (...) conditionals.\r
+REM See http://stackoverflow.com/questions/305605/weird-scope-issue-in-bat-file\r
+REM for more explanation.\r
+REM Precisely needed for configuring Visual Studio Environment.\r
setlocal enabledelayedexpansion\r
\r
-:: Does the user need help?\r
+REM Does the user need help?\r
if /I "%1" == "help" goto help\r
if /I "%1" == "/?" (\r
:help\r
exit /b\r
)\r
\r
-:: Special case %1 = arm_hosttools %2 = vcvarsall.bat %3 = %CMAKE_GENERATOR%\r
+REM Special case %1 = arm_hosttools %2 = vcvarsall.bat %3 = %CMAKE_GENERATOR%\r
if /I "%1" == "arm_hosttools" (\r
echo Configuring x86 host tools for ARM cross build\r
\r
- :: This launches %VSINSTALLDIR%VS\vcvarsall.bat\r
+ REM This launches %VSINSTALLDIR%VS\vcvarsall.bat\r
call %2 x86\r
\r
- :: Configure host tools for x86\r
+ REM Configure host tools for x86.\r
cmake -G %3 -DARCH:STRING=i386 %~dp0\r
- endlocal\r
- exit /b\r
+ exit\r
)\r
\r
-:: Get the source root directory\r
+REM Get the source root directory\r
set REACTOS_SOURCE_DIR=%~dp0\r
\r
-:: Set default generator\r
+REM Set default generator\r
set CMAKE_GENERATOR="Ninja"\r
set CMAKE_GENERATOR_HOST=!CMAKE_GENERATOR!\r
\r
-:: Detect presence of cmake\r
+REM Detect presence of cmake\r
cmd /c cmake --version 2>&1 | find "cmake version" > NUL || goto cmake_notfound\r
\r
-:: Detect build environment (MinGW, VS, WDK, ...)\r
+REM Detect build environment (MinGW, VS, WDK, ...)\r
if defined ROS_ARCH (\r
echo Detected RosBE for %ROS_ARCH%\r
set BUILD_ENVIRONMENT=MinGW\r
set MINGW_TOOCHAIN_FILE=toolchain-gcc.cmake\r
\r
) else if defined VCINSTALLDIR (\r
- :: VS command prompt does not put this in environment vars\r
+ REM VS command prompt does not put this in environment vars\r
cl 2>&1 | find "x86" > NUL && set ARCH=i386\r
cl 2>&1 | find "x64" > NUL && set ARCH=amd64\r
cl 2>&1 | find "ARM" > NUL && set ARCH=arm\r
exit /b\r
)\r
\r
-:: Checkpoint\r
+REM Checkpoint\r
if not defined ARCH (\r
echo Unknown build architecture\r
endlocal\r
exit /b\r
)\r
\r
-set NEW_STYLE_BUILD=0\r
+set NEW_STYLE_BUILD=1\r
\r
-:: Parse command line parameters\r
+REM Parse command line parameters\r
:repeat\r
if /I "%1%" == "-DNEW_STYLE_BUILD" (\r
set NEW_STYLE_BUILD=%2\r
)\r
)\r
\r
- :: Go to next parameter\r
+ REM Go to next parameter\r
SHIFT\r
goto repeat\r
:continue\r
\r
-:: Inform the user about the default build\r
+REM Inform the user about the default build\r
if "!CMAKE_GENERATOR!" == "Ninja" (\r
echo This script defaults to Ninja. Type "configure help" for alternative options.\r
)\r
\r
-:: Create directories\r
+REM Create directories\r
set REACTOS_OUTPUT_PATH=output-%BUILD_ENVIRONMENT%-%ARCH%\r
if "%REACTOS_SOURCE_DIR%" == "%CD%\" (\r
echo Creating directories in %REACTOS_OUTPUT_PATH%\r
\r
set REACTOS_BUILD_TOOLS_DIR=!CD!\r
\r
- :: Use x86 for ARM host tools\r
+ REM Use x86 for ARM host tools\r
if "%ARCH%" == "arm" (\r
- :: Launch new script instance for x86 host tools configuration\r
+ REM Launch new script instance for x86 host tools configuration\r
start "Preparing host tools for ARM cross build..." /I /B /WAIT %~dp0configure.cmd arm_hosttools "%VSINSTALLDIR%VC\vcvarsall.bat" %CMAKE_GENERATOR_HOST%\r
) else (\r
cmake -G %CMAKE_GENERATOR% -DARCH:STRING=%ARCH% "%REACTOS_SOURCE_DIR%"\r
\r
if EXIST CMakeCache.txt (\r
del CMakeCache.txt /q\r
+ del host-tools\CMakeCache.txt /q\r
)\r
\r
if "%NEW_STYLE_BUILD%"=="0" (\r