Welcome to mirror list, hosted at ThFree Co, Russian Federation.

package-release.sh - github.com/jp7677/dxvk-nvapi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: de48c0f010dfae473734c7c1ca1d24cf625ceb9a (plain)
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
91
92
93
94
95
96
97
98
99
100
#!/bin/bash

set -e

shopt -s extglob

if [ -z "$1" ] || [ -z "$2" ]; then
  echo "Usage: $0 version destdir"
  exit 1
fi

VERSION="$1"
SRC_DIR=$(dirname "$(readlink -f "$0")")
BUILD_DIR=$(realpath "$2")"/dxvk-nvapi-$VERSION"

if [ -e "$BUILD_DIR" ]; then
  echo "Build directory $BUILD_DIR already exists"
  exit 1
fi

shift 2

opt_enabletests=false
opt_devbuild=0

crossfile="build-win"

while [ $# -gt 0 ]; do
  case "$1" in
  "--no-package")
    echo "Ignoring option: --no-package"
    ;;
  "--enable-tests")
    opt_enabletests=true
    ;;
  "--dev-build")
    opt_devbuild=1
    ;;
  *)
    echo "Unrecognized option: $1" >&2
    exit 1
  esac
  shift
done

function prepare {
  python3 validate-methods.py \
    src/nvapi.cpp             \
    src/nvapi_sys.cpp         \
    src/nvapi_disp.cpp        \
    src/nvapi_mosaic.cpp      \
    src/nvapi_drs.cpp         \
    src/nvapi_gpu.cpp         \
    src/nvapi_d3d.cpp         \
    src/nvapi_d3d11.cpp       \
    src/nvapi_d3d12.cpp       \
    src/nvapi_interface.cpp   \
    inc/nvapi_interface.h

  # remove existing version.h, because otherwise the existing one gets into the build instead of the generated one
  if [ -e version.h ]; then
    rm version.h
  fi
}

function build_arch {
  cd "$SRC_DIR"

  meson setup                                \
    --cross-file "$SRC_DIR/$crossfile$1.txt" \
    --buildtype "release"                    \
    --prefix "$BUILD_DIR"                    \
    --strip                                  \
    --bindir "x$1"                           \
    --libdir "x$1"                           \
    -Denable_tests=$opt_enabletests          \
    "$BUILD_DIR/build.$1"

  cd "$BUILD_DIR/build.$1"
  ninja install

  cp version.h "$SRC_DIR"

  if [ $opt_devbuild -eq 0 ]; then
    # get rid of some useless .a files
    rm "$BUILD_DIR/x$1/"*.!(dll|exe)
    rm -R "$BUILD_DIR/build.$1"
  fi
}

function copy_extra {
  cd "$SRC_DIR"
  cp LICENSE "$BUILD_DIR"
  cp README.md "$BUILD_DIR"
}

prepare
build_arch 32
build_arch 64
copy_extra