forked from Apollo3zehn/EtherCAT.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init_solution.ps1
48 lines (43 loc) · 1.23 KB
/
init_solution.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
Write-Host "Updating Git submodule."
git submodule update --init --recursive --quiet
# x86
Write-Host "Creating native x86 project."
$path = "$($PSScriptRoot)/artifacts/bin32"
New-Item -Force -ItemType directory -Path $path
Set-Location -Path $path
if ($IsWindows)
{
cmake ./../../native -DCMAKE_CONFIGURATION_TYPES:STRING="Debug;Release" -G "Visual Studio 16 2019" -A "Win32"
}
elseif ($IsLinux)
{
cmake ./../../native -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY
}
elseif ($IsMacOS)
{
# The i386 architecture is deprecated for macOS
throw [System.PlatformNotSupportedException]
}
else
{
throw [System.PlatformNotSupportedException]
}
# x64
Write-Host "Creating native x64 project."
$path = "$($PSScriptRoot)/artifacts/bin64"
New-Item -Force -ItemType directory -Path $path
Set-Location -Path $path
if ($IsWindows)
{
cmake ./../../native -DCMAKE_CONFIGURATION_TYPES:STRING="Debug;Release" -G "Visual Studio 16 2019" -A "x64"
}
elseif ($IsLinux -or $IsMacOS)
{
cmake ./../../native -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-m64 -DCMAKE_CXX_FLAGS=-m64
}
else
{
throw [System.PlatformNotSupportedException]
}
# return
Set-Location -Path $PSScriptRoot