-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.ps1
63 lines (57 loc) · 1.68 KB
/
debug.ps1
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
$cfiles = [System.Collections.ArrayList]::new()
$unrecognized = [System.Collections.ArrayList]::new()
foreach ($arg in $args) {
if ($arg -clike "*.cpp") {
[void]$cfiles.Add($arg.ToString().Replace(".\", ""))
}
else {
[void]$unrecognized.Add($arg)
}
}
if ($unrecognized.Count -ne 0) {
Write-Error "Incompatible files passed for compilation: ${unrecognized}"
Exit 1
}
$cflags = @(
"/arch:AVX512",
"/diagnostics:caret",
"/DDEBUG",
"/D_DEBUG",
"/D__TEST__",
"/EHa",
"/F0x10485100",
"/favor:INTEL64",
"/fp:strict",
"/fpcvt:IA",
"/GL",
"/Gw",
"/I./",
"/I./include/",
"/jumptablerdata",
"/MP",
"/MTd",
"/Od",
"/Qpar",
"/Qspectre",
"/std:c++20",
"/TP",
"/Wall",
"/wd4505",
"/wd4710",
"/wd4711",
"/wd4820",
"/wd5045",
"/Zc:__cplusplus",
"/Zc:preprocessor",
"/link /DEBUG:FULL"
)
Write-Host "cl.exe ${cfiles} ${cflags}" -ForegroundColor Cyan
cl.exe $cfiles $cflags
Get-ChildItem *.obj -Recurse | Foreach-Object {Remove-Item $_.FullName -Force}
Get-ChildItem *.o -Recurse | Foreach-Object {Remove-Item $_.FullName -Force}
Get-ChildItem *.pdb -Recurse | Foreach-Object {Remove-Item $_.FullName -Force}
Get-ChildItem *.exp -Recurse | Foreach-Object {Remove-Item $_.FullName -Force}
Get-ChildItem *.dll -Recurse | Foreach-Object {Remove-Item $_.FullName -Force}
Get-ChildItem *.lib -Recurse | Foreach-Object {Remove-Item $_.FullName -Force}
Get-ChildItem *.ilk -Recurse | Foreach-Object {Remove-Item $_.FullName -Force}
Get-ChildItem *.i -Recurse | Foreach-Object {Remove-Item $_.FullName -Force}