File: build.ps1

package info (click to toggle)
python-pygit2 1.19.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,888 kB
  • sloc: ansic: 12,381; python: 11,640; sh: 210; makefile: 26
file content (21 lines) | stat: -rw-r--r-- 838 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
if (!(Test-Path -Path "build")) {
    # in case the pygit2 package build/ workspace has not been created by cibuildwheel yet
    mkdir build
}
if (Test-Path -Path "$env:LIBGIT2_SRC") {
    Set-Location "$env:LIBGIT2_SRC"
    # for local runs, reuse build/libgit_src if it exists
    if (Test-Path -Path build) {
        # purge previous build env (likely for a different arch type)
        Remove-Item -Recurse -Force build
    }
    # ensure we are checked out to the right version
    git fetch --depth=1 --tags
    git checkout "v$env:LIBGIT2_VERSION"
} else {
    # from a fresh run (like in CI)
    git clone --depth=1 -b "v$env:LIBGIT2_VERSION" https://github.com/libgit2/libgit2.git $env:LIBGIT2_SRC
    Set-Location "$env:LIBGIT2_SRC"
}
cmake -B build -S . -DBUILD_TESTS=OFF
cmake --build build/ --config=Release --target install