From 0ea701c61b77d31a2e3dd7c0163f4165f682c294 Mon Sep 17 00:00:00 2001 From: pal1000 Date: Tue, 27 Feb 2018 22:26:00 +0200 Subject: [PATCH] Build script: Allow cancel build if LLVM is missing Code cleanup. Use double if statements instead of temp variables. --- buildenvconf.md | 2 +- buildscript/build.cmd | 39 ++++++++++++++++++--------------------- buildscript/readme.md | 5 +++-- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/buildenvconf.md b/buildenvconf.md index 277cd8e8..81c32078 100644 --- a/buildenvconf.md +++ b/buildenvconf.md @@ -42,7 +42,7 @@ Version | 2.7.14 ARCH | x64 pip version | 9.0.1 setuptools version | 38.5.1 -pywin32 / pywin32 version | 222 +pywin32 / pywin32 version | 223 scons version | 3.0.1 Mako version | 1.0.7 MarkupSafe version | 1.0 diff --git a/buildscript/build.cmd b/buildscript/build.cmd index 8121c99e..bc13fcd1 100644 --- a/buildscript/build.cmd +++ b/buildscript/build.cmd @@ -51,7 +51,7 @@ :build_llvm @if EXIST %mesa%\llvm set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n): @if /I NOT "%buildllvm%"=="y" GOTO prep_mesa -@echo. +@if EXIST %mesa%\llvm echo. @cd %mesa%\llvm @if EXIST %abi% RD /S /Q %abi% @if EXIST cmake-%abi% RD /S /Q cmake-%abi% @@ -64,10 +64,7 @@ @if /I "%ninja%"=="y" set PATH=%mesa%\ninja\;%PATH% @if %abi%==x64 set toolchain=%toolchain% Win64 @if "%toolchain%"=="Ninja Win64" set toolchain=Ninja -@set x64compile=n -@if %hostabi%==amd64 set x64compile=1 -@if /I NOT "%ninja%"=="y" set x64compile=%x64compile%2 -@if %x64compile%==12 set x64compiler= -Thost=x64 +@if /I NOT "%ninja%"=="y" if %hostabi%==amd64 set x64compiler= -Thost=x64 @set llvmbuildsys=%CD% @if "%toolchain%"=="Ninja" call %vsenv% @if "%toolchain%"=="Ninja" cd %llvmbuildsys% @@ -95,16 +92,15 @@ @echo Error: Git not found. Auto-patching disabled. @set prepfail=1 ) +@if NOT EXIST mesa if %prepfail%==1 echo Fatal: Both Mesa code and Git are missing. At least one is required. Execution halted. +@if NOT EXIST mesa if %prepfail%==1 GOTO distcreate @if NOT EXIST mesa echo Warning: Mesa3D source code not found. -@if NOT EXIST mesa set prepfail=%prepfail%2 -@if %prepfail% EQU 12 echo Fatal: Both Mesa code and Git are missing. At least one is required. Execution halted. -@if %prepfail% EQU 12 GOTO exit @if NOT EXIST mesa set /p haltmesabuild=Press Y to abort execution. Press any other key to download Mesa via Git: -@if /I "%haltmesabuild%"=="y" GOTO exit +@if /I "%haltmesabuild%"=="y" GOTO distcreate @if NOT EXIST mesa set branch=master @if NOT EXIST mesa set /p branch=Enter Mesa source code branch name - defaults to master: @if NOT EXIST mesa echo. -@if NOT EXIST mesa git clone --depth=1 --branch=%branch% git://anongit.freedesktop.org/mesa/mesa mesa +@if NOT EXIST mesa git clone --recurse-submodules --depth=1 --branch=%branch% git://anongit.freedesktop.org/mesa/mesa mesa @cd mesa @set LLVM=%mesa%\llvm\%abi% @rem set /p mesaver=