-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
38 lines (33 loc) · 1.26 KB
/
build.ps1
File metadata and controls
38 lines (33 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$path_splitter = $([System.IO.Path]::DirectorySeparatorChar)
$no_path_splitter = ''
$no_escape_splitter = '\\'
if ($path_splitter -eq '\') {
$no_path_splitter = '/'
} else {
$no_path_splitter = '\'
}
$buildignore_path = (Get-Location).Path + $path_splitter + '.buildignore'
[String[]]$buildignore_targets = [System.IO.File]::ReadAllLines($buildignore_path)
$current_location = $(Get-Location).Path + $path_splitter
foreach ($i in 0..($buildignore_targets.Count - 1)) {
$buildignore_targets[$i] = ($current_location + $buildignore_targets[$i]).Replace($no_escape_splitter, $path_splitter).Replace($no_path_splitter, $path_splitter)
}
(Get-ChildItem -r) | ForEach-Object {
[System.IO.FileSystemInfo]$info = $_
if (-Not $buildignore_targets.Contains($info.FullName)) {
if ($info.Name.EndsWith('.hpp')) {
echo "Compiling: $($info.Name)"
clang "$($info.FullName)" -S -Wall -Wpedantic -Wextra -Weffc++ -Werror -std=c++20 -Wfatal-errors -fsyntax-only -Og
if ($LASTEXITCODE -ne 0) {
break
}
}
elseif ($info.Name.EndsWith('.h')) {
echo "Compiling: $($info.Name)"
clang "$($info.FullName)" -S -Wall -Wpedantic -Wextra -Werror -Wfatal-errors -fsyntax-only -Og -std=c17
if ($LASTEXITCODE -ne 0) {
break
}
}
}
}