-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_cimgui.ps1
90 lines (84 loc) · 1.86 KB
/
build_cimgui.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
$option = $args[0]
if(($option -eq "make") -or (!$option))
{
#if(Test-Path build)
#{
# echo "Removing old build directory..."
# rm -Recurse build
#}
if (!(Test-Path build))
{
mkdir build
}
cd build
cmake ../ -DIMGUI_STATIC="ON"
cd ..
}
elseif($option -eq "clean")
{
if(Test-Path build)
{
echo "Removing old build directory..."
rm -Recurse build
}
else
{
echo "Already cleaned."
}
}
elseif($option -eq "build")
{
if(!(Test-Path build))
{
echo "Build directory doesn't exist."
}
else
{
cd build
if($args[1] -eq "DEBUG")
{
echo "Building debug..."
devenv /build Debug cimgui.sln
echo "Finished build."
echo "Copying library..."
$debugpath = "../ImGui/dist/Debug-Win64/"
if(!(Test-Path $debugpath))
{
mkdir $debugpath
}
cp -Path "Debug/*" -Destination $debugpath
}
else
{
echo "Building release..."
devenv /build Release cimgui.sln
echo "Finished build."
echo "Copying library..."
$releasepath = "../ImGui/dist/Release-Win64/"
if(!(Test-Path $releasepath))
{
mkdir $releasepath
}
cp -Path "Release/*" -Destination $releasepath
}
echo "CImGui compiled."
cd ..
}
}
elseif($option -eq "generate")
{
cd Generator
echo "Building generator..."
devenv /build Release Generator.sln
echo "Running generator..."
./bin/Release/netcoreapp3.1/Generator.exe
echo "Finished."
cd ..
}
elseif($option -eq "all")
{
./build_cimgui.ps1 make
./build_cimgui.ps1 build debug
./build_cimgui.ps1 build release
./build_cimgui.ps1 generate
}