forked from baldurk/renderdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinux_setup.sh
More file actions
32 lines (26 loc) · 1.49 KB
/
linux_setup.sh
File metadata and controls
32 lines (26 loc) · 1.49 KB
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
#!/bin/sh
set -ev
sudo add-apt-repository -y 'ppa:ubuntu-toolchain-r/test'
sudo add-apt-repository -y 'ppa:beineri/opt-qt562-trusty'
sudo add-apt-repository -y 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.8 main'
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update -qq
sudo apt-get install --allow-unauthenticated -y -qq libx11-dev mesa-common-dev libgl1-mesa-dev qt56base qt56x11extras libxcb-keysyms1-dev gdb clang-format-3.8
# check formatting matches clang-format-3.8. Since newer versions can have
# changes in formatting even without any rule changes, we have to fix on a
# single version.
clang-format-3.8 -i -style=file $(find qrenderdoc/ renderdoc/ renderdoccmd/ renderdocshim/ -type f -regex '.*\(/3rdparty/\|/official/\|resource.h\).*' -prune -o -regex '.*\.\(c\|cpp\|h\)$' -print)
git clean -f
# this swallows the exit code so we won't fail until we print the diff in
# the next line, but allows us to print a friendlier message to anyone
# looking at the build log
git diff --quiet || (
echo "***************************************************";
echo "*** The code is not clean against clang-format ***";
echo "*** Please run clang-format-3.8 and fix the ***";
echo "*** differences then rebase/squash them into ***";
echo "*** the relevant commits. Do not add a commit ***";
echo "*** for just formatting fixes. Thanks! ***";
echo "***************************************************";
)
git diff --exit-code