diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 375bab0a..cc15ba49 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -456,6 +456,12 @@ "{{ template_dir }}/scripts/Installers/Install-MinGW.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Clang.ps1" + ] + }, { "type": "powershell", "scripts":[ @@ -715,6 +721,12 @@ "{{ template_dir }}/scripts/Installers/Validate-MinGW.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-Clang.ps1" + ] + }, { "type": "powershell", "scripts":[ diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index c8acc4b5..24cae0e1 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -425,6 +425,12 @@ "{{ template_dir }}/scripts/Installers/Install-MinGW.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Clang.ps1" + ] + }, { "type": "powershell", "scripts":[ @@ -684,6 +690,12 @@ "{{ template_dir }}/scripts/Installers/Validate-MinGW.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-Clang.ps1" + ] + }, { "type": "powershell", "scripts":[ diff --git a/images/win/scripts/Installers/Install-Clang.ps1 b/images/win/scripts/Installers/Install-Clang.ps1 new file mode 100644 index 00000000..bd567a97 --- /dev/null +++ b/images/win/scripts/Installers/Install-Clang.ps1 @@ -0,0 +1,6 @@ +################################################################################ +## File: Install-Clang.ps1 +## Desc: Install Clang compiler as a part of LLVM framework for Windows +################################################################################ + +choco install -y llvm diff --git a/images/win/scripts/Installers/Validate-Clang.ps1 b/images/win/scripts/Installers/Validate-Clang.ps1 new file mode 100644 index 00000000..709943fa --- /dev/null +++ b/images/win/scripts/Installers/Validate-Clang.ps1 @@ -0,0 +1,46 @@ +################################################################################ +## File: Validate-Clang.ps1 +## Desc: Validate Clang installation +################################################################################ + +if (Get-Command -Name 'clang') +{ + Write-Host "clang is successfully installed:" + clang --version | Write-Host +} +else +{ + Write-Host "clang is not on PATH" + exit 1 +} + +if (Get-Command -Name 'clang++') +{ + Write-Host "clang++ is successfully installed:" + clang++ --version | Write-Host +} +else +{ + Write-Host "clang++ is not on PATH" + exit 1 +} + +# Adding description of the software to Markdown + +# `clang --version` gives output like: +# clang version 9.0.0 (tags/RELEASE_900/final) +# Target: x86_64-pc-windows-msvc +# Thread model: posix +# InstalledDir: C:\Program Files\LLVM\bin + +$SoftwareName = "Clang" +$(clang --version).Split([System.Environment]::NewLine)[0] -match "\d\.\d\.\d" +$Version = $matches[0] + +$Description = @" +_Version:_ $Version
+_Environment:_ +* PATH: contains location of the LLVM 'bin' directory +"@ + +Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description