From 5dd6295d7d6b23d9e51c07564bf944277a98c4d2 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Wed, 8 Jan 2020 07:45:00 +0100 Subject: [PATCH] Merge `configure` and `configure_msvc` to a single `configure` script that autodetects the environment. Should help with `build_rostests`, which previously ran the wrong script in an MSVC environment. --- master/master.cfg | 4 ++-- worker/README | 2 +- worker/configure | 24 +++++++++++++++++++++--- worker/configure_msvc | 21 --------------------- 4 files changed, 24 insertions(+), 27 deletions(-) delete mode 100755 worker/configure_msvc diff --git a/master/master.cfg b/master/master.cfg index 0b1e39a..ec4afbe 100644 --- a/master/master.cfg +++ b/master/master.cfg @@ -249,7 +249,7 @@ Build_MSVC_x86 = util.BuildFactory(); Build_MSVC_x86.addStep(bs_clean) Build_MSVC_x86.addStep(bs_git) Build_MSVC_x86.addStep(bs_prepare_source) -Build_MSVC_x86.addStep(steps.Compile(name="configure", command=["bash", scripts_root + "configure_msvc"], description=["configure"], descriptionDone=["configured"])) +Build_MSVC_x86.addStep(steps.Compile(name="configure", command=["bash", scripts_root + "configure"], description=["configure"], descriptionDone=["configured"])) Build_MSVC_x86.addStep(bs_bootcd) Build_MSVC_x86.addStep(bs_livecd) Build_MSVC_x86.addStep(bs_upload_iso) @@ -258,7 +258,7 @@ Build_MSVC_x64 = util.BuildFactory(); Build_MSVC_x64.addStep(bs_clean) Build_MSVC_x64.addStep(bs_git) Build_MSVC_x64.addStep(bs_prepare_source) -Build_MSVC_x64.addStep(steps.Compile(name="configure", command=["bash", scripts_root + "configure_msvc"], description=["configure"], descriptionDone=["configured"])) +Build_MSVC_x64.addStep(steps.Compile(name="configure", command=["bash", scripts_root + "configure"], description=["configure"], descriptionDone=["configured"])) Build_MSVC_x64.addStep(bs_bootcd) Build_MSVC_x64.addStep(bs_livecd) Build_MSVC_x64.addStep(steps.Compile(name="rostests", command=["bash", scripts_root + "build_rostests"], warningPattern="^(.*warning[: ].*|.*error[: ].*)", description=["rostests"], descriptionDone=["rostests"])) diff --git a/worker/README b/worker/README index 517dd9f..72f7a18 100644 --- a/worker/README +++ b/worker/README @@ -18,7 +18,7 @@ Step | Plainbot | Testbot clean * Git update * prepare_source * -configure / configure_msvc * +configure * build_reactos bootcd * build_reactos livecd * regtestcd * diff --git a/worker/configure b/worker/configure index d97b112..f2180be 100755 --- a/worker/configure +++ b/worker/configure @@ -5,9 +5,27 @@ # Parameters - Additional configuration options directly passed to CMake. source ../../config.inc -mkdir -p $CCACHE_DIR -ccache -M $CCACHE_MEMORY +# +# Default configuration in config.inc is RosBE/GCC-related +# MSVC configuration requires overwrites in builder_config.inc like this: +# +#export INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um" +#export LIB="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86" +#export LIBPATH="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB" +#export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/BIN:/cygdrive/c/Program Files (x86)/Windows Kits/8.1/bin/x86:$ROSBE_DIR/bin:/usr/bin:/cygdrive/c/Windows/System32/wbem:/cygdrive/c/Windows/System32" +#export ROS_OUTPUT="$WORKDIR/output-VS-$ROS_ARCH" +# mkdir -p $ROS_OUTPUT cd $ROS_OUTPUT -$TIME cmake -G 'Ninja' -DENABLE_CCACHE:BOOL=1 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-gcc.cmake -DARCH:STRING=$ROS_ARCH $@ $SOURCEDIR + +if cl 2>&1 >/dev/null; then + # MSVC environment + $TIME cmake -G 'Ninja' -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=$ROS_ARCH -DRUNTIME_CHECKS:BOOL=0 $@ $SOURCEDIR +else + # GCC environment + mkdir -p $CCACHE_DIR + ccache -M $CCACHE_MEMORY + + $TIME cmake -G 'Ninja' -DENABLE_CCACHE:BOOL=1 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-gcc.cmake -DARCH:STRING=$ROS_ARCH $@ $SOURCEDIR +fi diff --git a/worker/configure_msvc b/worker/configure_msvc deleted file mode 100755 index 4dbb14d..0000000 --- a/worker/configure_msvc +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# ReactOS BuildBot Build Scripts -# configure - Set up the environment for building and let CMake generate build files. -# -# Parameters - Additional configuration options directly passed to CMake. -source ../../config.inc - -# -# Default configuration in config.inc is RosBE/GCC-related -# MSVC configuration requires overwrites in builder_config.inc like this: -# -#export INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um" -#export LIB="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86" -#export LIBPATH="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB" -#export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/BIN:/cygdrive/c/Program Files (x86)/Windows Kits/8.1/bin/x86:$ROSBE_DIR/bin:/usr/bin:/cygdrive/c/Windows/System32/wbem:/cygdrive/c/Windows/System32" -#export ROS_OUTPUT="$WORKDIR/output-VS-$ROS_ARCH" -# - -mkdir -p $ROS_OUTPUT -cd $ROS_OUTPUT -$TIME cmake -G 'Ninja' -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=$ROS_ARCH -DRUNTIME_CHECKS:BOOL=0 $@ $SOURCEDIR