From 9e808b3d2848d176673b10e1724f003f801a6565 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 9 Jul 2017 10:28:45 +0000 Subject: [PATCH] Fix compilation when no sln files exist. --- Makefile | 12 ++++++------ make.ps1 | 10 ++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 467a851..0df1be3 100644 --- a/Makefile +++ b/Makefile @@ -49,19 +49,19 @@ utility: engine build: engine ifeq ("$(HAS_MSBUILD)","") - @xbuild /nologo /verbosity:quiet /p:TreatWarningsAsErrors=true + @find . -maxdepth 1 -name '*.sln' -exec xbuild /nologo /verbosity:quiet /p:TreatWarningsAsErrors=true \; else - @msbuild /t:Rebuild /nr:false + @find . -maxdepth 1 -name '*.sln' -exec msbuild /t:Rebuild /nr:false \; endif - @printf "The mod logic has been built.\n" + @find . -maxdepth 1 -name '*.sln' -exec printf "The mod logic has been built.\n" \; clean: engine ifeq ("$(HAS_MSBUILD)","") - @xbuild /nologo /verbosity:quiet /p:TreatWarningsAsErrors=true /t:Clean + @find . -maxdepth 1 -name '*.sln' -exec xbuild /nologo /verbosity:quiet /p:TreatWarningsAsErrors=true /t:Clean \; else - @msbuild /t:Clean /nr:false + @find . -maxdepth 1 -name '*.sln' -exec msbuild /t:Clean /nr:false \; endif - @printf "The mod logic has been cleaned.\n" + @find . -maxdepth 1 -name '*.sln' -exec printf "The mod logic has been cleaned.\n" \; @cd $(ENGINE_DIRECTORY) && make clean @printf "The engine has been cleaned.\n" diff --git a/make.ps1 b/make.ps1 index 6e21792..28cf261 100644 --- a/make.ps1 +++ b/make.ps1 @@ -5,6 +5,11 @@ ############################################################### function All-Command { + If (!(Test-Path "*.sln")) + { + return + } + $msBuild = FindMSBuild $msBuildArguments = "/t:Rebuild /nr:false" if ($msBuild -eq $null) @@ -27,6 +32,11 @@ function All-Command function Clean-Command { + If (!(Test-Path "*.sln")) + { + return + } + $msBuild = FindMSBuild $msBuildArguments = "/t:Clean /nr:false" if ($msBuild -eq $null)