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

github.com/jp7677/dxvk-nvapi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Peters <jp7677@gmail.com>2022-06-15 22:53:41 +0300
committerJens Peters <jp7677@gmail.com>2022-06-15 22:53:41 +0300
commit8ad316172af29ca9b3c406a5e04aeaf81285a952 (patch)
tree57cd040c10c70cd12c805ecad26c40662ec850e8
parentb344f02da8785da651861d45fc9615d4461f4087 (diff)
build: Add script for creating compilation database
Was about time to automate this...
-rwxr-xr-xcreate-compilation-database.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/create-compilation-database.sh b/create-compilation-database.sh
new file mode 100755
index 0000000..3cb707c
--- /dev/null
+++ b/create-compilation-database.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+set -e
+
+shopt -s extglob
+
+DB="compile_commands.json"
+SRC_DIR=$(dirname "$(readlink -f "$0")")
+BUILD_DIR="$SRC_DIR/db"
+
+if [ -e "$BUILD_DIR" ]; then
+ echo "Build directory $BUILD_DIR already exists"
+ exit 1
+fi
+
+if [ -e "$DB" ]; then
+ echo "Clang Compilation Database ($DB) already exists"
+ exit 1
+fi
+
+mkdir "$BUILD_DIR"
+
+meson --cross-file "$SRC_DIR/build-win64.txt" \
+ --buildtype "release" \
+ --prefix "$BUILD_DIR" \
+ --strip \
+ --bindir "x64" \
+ --libdir "x64" \
+ -Denable_tests=True \
+ "$BUILD_DIR"
+
+sed -i 's/\/db"/\/"/g; s/\.\.\///g' "$BUILD_DIR"/"$DB"
+
+cp "$BUILD_DIR"/"$DB" "$SRC_DIR"
+rm -R "$BUILD_DIR"
+
+echo "Clang Compilation Database ($DB) created"