From df79c3c6a6a8250ea558547f29ad2d80dfde9116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=BChnel?= Date: Fri, 31 Jan 2020 11:56:34 +0000 Subject: [PATCH] added flag to select projects --- scripts/run_cmake.ps1 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/run_cmake.ps1 b/scripts/run_cmake.ps1 index 10fb34e..7540dc6 100644 --- a/scripts/run_cmake.ps1 +++ b/scripts/run_cmake.ps1 @@ -12,8 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. +param ( + [Parameter(Mandatory=$false)][string]$projects="default" +) + . ${PSScriptRoot}\common.ps1 +# set LLVM_ENABLE_PROJECTS to default value +# if -DetectProjects is set the projects are detected based on the files +# that were modified in the working copy +if ($projects -eq "default") { + $LLVM_ENABLE_PROJECTS="clang;clang-tools-extra;libcxx;libcxxabi;lld;libunwind;mlir" +} elseif ($projects -eq "detect") { + $LLVM_ENABLE_PROJECTS = (git diff | python ${PSScriptRoot}\choose_projects.py . ) | Out-String +} else { + $LLVM_ENABLE_PROJECTS=$projects +} + +Write-Output "Setting LLVM_ENABLE_PROJECTS=${LLVM_ENABLE_PROJECTS}" + # Delete and re-create build folder Remove-Item build -Recurse -ErrorAction Ignore New-Item -ItemType Directory -Force -Path build | Out-Null @@ -25,7 +42,7 @@ Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools # call CMake Invoke-Call -ScriptBlock { cmake ..\llvm -G Ninja -DCMAKE_BUILD_TYPE=Release ` - -D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra;libcxx;libcxxabi;lld;libunwind;mlir" ` + -D LLVM_ENABLE_PROJECTS="${LLVM_ENABLE_PROJECTS}" ` -D LLVM_ENABLE_ASSERTIONS=ON ` -DLLVM_LIT_ARGS="-v --xunit-xml-output test-results.xml" ` -D LLVM_ENABLE_DIA_SDK=OFF