Index: reactos/configure.cmd =================================================================== --- reactos/configure.cmd (revision 71607) +++ reactos/configure.cmd (working copy) @@ -15,8 +15,7 @@ echo Syntax: path\to\source\configure.cmd [script-options] [Cmake-options] echo Available script-options: Codeblocks, Eclipse, Makefiles, clang, VSSolution, RTC echo Cmake-options: -DVARIABLE:TYPE=VALUE - endlocal - exit /b + goto quit ) REM Special case %1 = arm_hosttools %2 = vcvarsall.bat %3 = %CMAKE_GENERATOR% @@ -60,8 +59,7 @@ cl 2>&1 | find "19.00." > NUL && set VS_VERSION=14 if not defined VS_VERSION ( echo Error: Visual Studio version too old or version detection failed. - endlocal - exit /b + goto quit ) set BUILD_ENVIRONMENT=VS set VS_SOLUTION=0 @@ -69,15 +67,13 @@ echo Detected Visual Studio Environment !BUILD_ENVIRONMENT!!VS_VERSION!-!ARCH! ) else ( echo Error: Unable to detect build environment. Configure script failure. - endlocal - exit /b + goto quit ) REM Checkpoint if not defined ARCH ( echo Unknown build architecture - endlocal - exit /b + goto quit ) set NEW_STYLE_BUILD=1 @@ -84,7 +80,7 @@ REM Parse command line parameters :repeat - if /I "%1%" == "-DNEW_STYLE_BUILD" ( + if /I "%1" == "-DNEW_STYLE_BUILD" ( set NEW_STYLE_BUILD=%2 ) else if "%BUILD_ENVIRONMENT%" == "MinGW" ( if /I "%1" == "Codeblocks" ( @@ -95,6 +91,12 @@ set CMAKE_GENERATOR="MinGW Makefiles" ) else if /I "%1" == "clang" ( set MINGW_TOOCHAIN_FILE=toolchain-clang.cmake + ) else if /I "%1" == "VSSolution" ( + echo. && echo Error: Creation of VS Solution files is not supported in a MinGW environment. + echo Please run this command in a [Developer] Command Prompt for Visual Studio. + goto quit + ) else if /I "%1" == "RTC" ( + echo. && echo Warning: RTC switch is ignored outside of a Visual Studio environment. && echo. ) else ( goto continue ) @@ -167,7 +169,13 @@ REM Create directories set REACTOS_OUTPUT_PATH=output-%BUILD_ENVIRONMENT%-%ARCH% + +if "%VS_SOLUTION%" == "1" ( + set REACTOS_OUTPUT_PATH=%REACTOS_OUTPUT_PATH%-sln +) + if "%REACTOS_SOURCE_DIR%" == "%CD%\" ( + set CD_SAME_AS_SOURCE=1 echo Creating directories in %REACTOS_OUTPUT_PATH% if not exist %REACTOS_OUTPUT_PATH% ( @@ -176,6 +184,21 @@ cd %REACTOS_OUTPUT_PATH% ) +if "%VS_SOLUTION%" == "1" ( + + if exist build.ninja ( + echo. && echo Error: This directory has already been configured for ninja. + echo An output folder configured for ninja can't be reconfigured for VSSolution. + echo Use an empty folder or delete the contents of this folder, then try again. + goto quit + ) +) else if exist REACTOS.sln ( + echo. && echo Error: This directory has already been configured for Visual Studio. + echo An output folder configured for VSSolution can't be reconfigured for ninja. + echo Use an empty folder or delete the contents of this folder, then try again. && echo. + goto quit +) + if "%NEW_STYLE_BUILD%"=="0" ( if not exist host-tools ( @@ -231,11 +254,17 @@ cd.. ) -echo Configure script complete^^! Execute appropriate build commands (ex: ninja, make, nmake, etc...). -endlocal -exit /b +if "%CD_SAME_AS_SOURCE%" == "1" ( + set ENDV= from %REACTOS_OUTPUT_PATH%. +) else ( + set ENDV=. +) +echo Configure script complete^^! Execute appropriate build commands ^(ex: ninja, make, nmake, etc...^)%ENDV% +goto quit :cmake_notfound echo Unable to find cmake, if it is installed, check your PATH variable. + +:quit endlocal exit /b