mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 02:25:40 +00:00
[CONFIGURE] First step towards introducing a way to compile ReactOS without invoking CMake twice. NFC. CORE-10121
svn path=/trunk/; revision=69058
This commit is contained in:
parent
7bc39e5dae
commit
c4cd6e2035
1 changed files with 54 additions and 27 deletions
|
@ -15,6 +15,7 @@ if /I "%1" == "/?" (
|
||||||
echo Syntax: path\to\source\configure.cmd [script-options] [Cmake-options]
|
echo Syntax: path\to\source\configure.cmd [script-options] [Cmake-options]
|
||||||
echo Available script-options: Codeblocks, Eclipse, Makefiles, clang, VSSolution, RTC
|
echo Available script-options: Codeblocks, Eclipse, Makefiles, clang, VSSolution, RTC
|
||||||
echo Cmake-options: -DVARIABLE:TYPE=VALUE
|
echo Cmake-options: -DVARIABLE:TYPE=VALUE
|
||||||
|
endlocal
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -27,7 +28,8 @@ if /I "%1" == "arm_hosttools" (
|
||||||
|
|
||||||
:: Configure host tools for x86
|
:: Configure host tools for x86
|
||||||
cmake -G %3 -DARCH:STRING=i386 %~dp0
|
cmake -G %3 -DARCH:STRING=i386 %~dp0
|
||||||
exit
|
endlocal
|
||||||
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Get the source root directory
|
:: Get the source root directory
|
||||||
|
@ -59,6 +61,7 @@ if defined ROS_ARCH (
|
||||||
cl 2>&1 | find "19.00." > NUL && set VS_VERSION=14
|
cl 2>&1 | find "19.00." > NUL && set VS_VERSION=14
|
||||||
if not defined VS_VERSION (
|
if not defined VS_VERSION (
|
||||||
echo Error: Visual Studio version too old or version detection failed.
|
echo Error: Visual Studio version too old or version detection failed.
|
||||||
|
endlocal
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
set BUILD_ENVIRONMENT=VS
|
set BUILD_ENVIRONMENT=VS
|
||||||
|
@ -67,18 +70,24 @@ if defined ROS_ARCH (
|
||||||
echo Detected Visual Studio Environment !BUILD_ENVIRONMENT!!VS_VERSION!-!ARCH!
|
echo Detected Visual Studio Environment !BUILD_ENVIRONMENT!!VS_VERSION!-!ARCH!
|
||||||
) else (
|
) else (
|
||||||
echo Error: Unable to detect build environment. Configure script failure.
|
echo Error: Unable to detect build environment. Configure script failure.
|
||||||
|
endlocal
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Checkpoint
|
:: Checkpoint
|
||||||
if not defined ARCH (
|
if not defined ARCH (
|
||||||
echo Unknown build architecture
|
echo Unknown build architecture
|
||||||
|
endlocal
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set NEW_STYLE_BUILD=0
|
||||||
|
|
||||||
:: Parse command line parameters
|
:: Parse command line parameters
|
||||||
:repeat
|
:repeat
|
||||||
if "%BUILD_ENVIRONMENT%" == "MinGW" (
|
if /I "%1%" == "-DNEW_STYLE_BUILD" (
|
||||||
|
set NEW_STYLE_BUILD=%2
|
||||||
|
) else if "%BUILD_ENVIRONMENT%" == "MinGW" (
|
||||||
if /I "%1" == "Codeblocks" (
|
if /I "%1" == "Codeblocks" (
|
||||||
set CMAKE_GENERATOR="CodeBlocks - MinGW Makefiles"
|
set CMAKE_GENERATOR="CodeBlocks - MinGW Makefiles"
|
||||||
) else if /I "%1" == "Eclipse" (
|
) else if /I "%1" == "Eclipse" (
|
||||||
|
@ -168,47 +177,65 @@ if "%REACTOS_SOURCE_DIR%" == "%CD%\" (
|
||||||
cd %REACTOS_OUTPUT_PATH%
|
cd %REACTOS_OUTPUT_PATH%
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist host-tools (
|
if "%NEW_STYLE_BUILD%"=="0" (
|
||||||
|
|
||||||
|
if not exist host-tools (
|
||||||
mkdir host-tools
|
mkdir host-tools
|
||||||
)
|
)
|
||||||
if not exist reactos (
|
|
||||||
|
if not exist reactos (
|
||||||
mkdir reactos
|
mkdir reactos
|
||||||
)
|
)
|
||||||
|
|
||||||
echo Preparing host tools...
|
echo Preparing host tools...
|
||||||
cd host-tools
|
cd host-tools
|
||||||
if EXIST CMakeCache.txt (
|
if EXIST CMakeCache.txt (
|
||||||
del CMakeCache.txt /q
|
del CMakeCache.txt /q
|
||||||
)
|
)
|
||||||
set REACTOS_BUILD_TOOLS_DIR=%CD%
|
|
||||||
|
|
||||||
:: Use x86 for ARM host tools
|
set REACTOS_BUILD_TOOLS_DIR=!CD!
|
||||||
if "%ARCH%" == "arm" (
|
|
||||||
|
:: Use x86 for ARM host tools
|
||||||
|
if "%ARCH%" == "arm" (
|
||||||
:: Launch new script instance for x86 host tools configuration
|
:: Launch new script instance for x86 host tools configuration
|
||||||
start "Preparing host tools for ARM cross build..." /I /B /WAIT %~dp0configure.cmd arm_hosttools "%VSINSTALLDIR%VC\vcvarsall.bat" %CMAKE_GENERATOR_HOST%
|
start "Preparing host tools for ARM cross build..." /I /B /WAIT %~dp0configure.cmd arm_hosttools "%VSINSTALLDIR%VC\vcvarsall.bat" %CMAKE_GENERATOR_HOST%
|
||||||
) else (
|
) else (
|
||||||
cmake -G %CMAKE_GENERATOR% -DARCH:STRING=%ARCH% "%REACTOS_SOURCE_DIR%"
|
cmake -G %CMAKE_GENERATOR% -DARCH:STRING=%ARCH% "%REACTOS_SOURCE_DIR%"
|
||||||
|
)
|
||||||
|
|
||||||
|
cd..
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
cd..
|
|
||||||
|
|
||||||
echo Preparing reactos...
|
echo Preparing reactos...
|
||||||
cd reactos
|
|
||||||
|
if "%NEW_STYLE_BUILD%"=="0" (
|
||||||
|
cd reactos
|
||||||
|
)
|
||||||
|
|
||||||
if EXIST CMakeCache.txt (
|
if EXIST CMakeCache.txt (
|
||||||
del CMakeCache.txt /q
|
del CMakeCache.txt /q
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if "%NEW_STYLE_BUILD%"=="0" (
|
||||||
|
set BUILD_TOOLS_FLAG=-DREACTOS_BUILD_TOOLS_DIR:PATH="%REACTOS_BUILD_TOOLS_DIR%"
|
||||||
|
)
|
||||||
|
|
||||||
if "%BUILD_ENVIRONMENT%" == "MinGW" (
|
if "%BUILD_ENVIRONMENT%" == "MinGW" (
|
||||||
cmake -G %CMAKE_GENERATOR% -DENABLE_CCACHE:BOOL=0 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=%MINGW_TOOCHAIN_FILE% -DARCH:STRING=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:PATH="%REACTOS_BUILD_TOOLS_DIR%" %* "%REACTOS_SOURCE_DIR%"
|
cmake -G %CMAKE_GENERATOR% -DENABLE_CCACHE:BOOL=0 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=%MINGW_TOOCHAIN_FILE% -DARCH:STRING=%ARCH% %BUILD_TOOLS_FLAG% %* "%REACTOS_SOURCE_DIR%"
|
||||||
) else (
|
) else (
|
||||||
cmake -G %CMAKE_GENERATOR% -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:PATH="%REACTOS_BUILD_TOOLS_DIR%" -DRUNTIME_CHECKS:BOOL=%VS_RUNTIME_CHECKS% %* "%REACTOS_SOURCE_DIR%"
|
cmake -G %CMAKE_GENERATOR% -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=%ARCH% %BUILD_TOOLS_FLAG% -DRUNTIME_CHECKS:BOOL=%VS_RUNTIME_CHECKS% %* "%REACTOS_SOURCE_DIR%"
|
||||||
)
|
)
|
||||||
|
|
||||||
cd..
|
if "%NEW_STYLE_BUILD%"=="0" (
|
||||||
|
cd..
|
||||||
|
)
|
||||||
|
|
||||||
echo Configure script complete^^! Enter directories and execute appropriate build commands (ex: ninja, make, nmake, etc...).
|
echo Configure script complete^^! Execute appropriate build commands (ex: ninja, make, nmake, etc...).
|
||||||
|
endlocal
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
:cmake_notfound
|
:cmake_notfound
|
||||||
echo Unable to find cmake, if it is installed, check your PATH variable.
|
echo Unable to find cmake, if it is installed, check your PATH variable.
|
||||||
|
endlocal
|
||||||
exit /b
|
exit /b
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue