File: GenerateImportLibraries.ps1

package info (click to toggle)
libcsfml 3.0.0~rc3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,236 kB
  • sloc: cpp: 7,741; ansic: 2,616; sh: 791; makefile: 16
file content (35 lines) | stat: -rw-r--r-- 880 bytes parent folder | download | duplicates (2)
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
Param(
    [Parameter(Mandatory, Position = 0)]
    [string]$architecture
)

Function Convert-DLL([string]$name)
{
    & gendef.exe "..\..\bin\$name-2.dll"
    & dlltool.exe -d "$name-2.def" -D "..\..\bin\$name-2.dll" -l "lib$name.a"
    del "$name-2.def"
}

Function Create-ImportLib([string]$architecture)
{
    New-Item -ItemType "directory" -Path "lib\gcc"
    New-Item -ItemType "directory" -Path "lib\msvc"
    Move-Item -Path "lib\*.lib" -Destination "lib\msvc"

    $patharch = If($architecture -eq "x64") { "64" } Else { "32" }

    $oldpath = $env:Path
    $env:Path += ";C:\tools\mingw$patharch\bin\"

    Push-Location "lib\gcc"
    Convert-DLL("csfml-graphics")
    Convert-DLL("csfml-window")
    Convert-DLL("csfml-audio")
    Convert-DLL("csfml-network")
    Convert-DLL("csfml-system")
    Pop-Location

    $env:Path = $oldpath
}

Create-ImportLib $architecture