summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAlexander Lanin <alex@lanin.de>2020-06-14 09:59:00 +0200
committerGitHub <noreply@github.com>2020-06-14 09:59:00 +0200
commitf2341b2ba3369d5641a53deb3f6b1d513a8924e2 (patch)
tree229095217e949396920dbe3b77712bef25587775 /misc
parentb1fcfbca224b2af5b6499794edd8615dbc3dc7b5 (diff)
downloadccache-f2341b2ba3369d5641a53deb3f6b1d513a8924e2.tar.gz
Switch to CMake (#573)
Co-authored-by: Cristian Adam <cristian.adam@gmail.com> Co-authored-by: Joel Rosdahl <joel@rosdahl.net>
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/build.sh6
-rwxr-xr-xmisc/check_format.sh22
-rwxr-xr-xmisc/format.sh20
-rw-r--r--misc/freebsd/README12
-rw-r--r--misc/freebsd/Vagrantfile23
5 files changed, 40 insertions, 43 deletions
diff --git a/misc/build.sh b/misc/build.sh
deleted file mode 100755
index f46c6994..00000000
--- a/misc/build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh -ex
-# doc/INSTALL.md
-./autogen.sh
-./configure
-make
-make ${*:-test}
diff --git a/misc/check_format.sh b/misc/check_format.sh
index 56ee3db2..dff3d94d 100755
--- a/misc/check_format.sh
+++ b/misc/check_format.sh
@@ -1,4 +1,24 @@
-#!/bin/sh -ex
+#!/bin/sh -e
+
+if [ -n "${VERBOSE}" ]; then
+ set -x
+fi
# xarg returns 1 if any run-clang-format call returns 1.
+clang-format --version
find src unittest -path src/third_party -prune -o -regex ".*\.[ch]p?p?" -print0 | xargs -0 -n1 misc/run-clang-format --check
+
+# Top level CMakeLists.txt + subidrectories.
+# This avoids running the check on any build directories.
+if hash cmake-format 2>/dev/null; then
+ printf "cmake-format version "
+ cmake-format --version
+ CLANG_FORMAT=cmake-format misc/run-clang-format --check CMakeLists.txt
+ find cmake -name "*.cmake" -print0 | CLANG_FORMAT=cmake-format xargs -0 -n1 misc/run-clang-format --check
+ find src unittest -name "CMakeLists.txt" -print0 | CLANG_FORMAT=cmake-format xargs -0 -n1 misc/run-clang-format --check
+else
+ echo "Note: cmake-format not installed. CMake files will not be checked for correct formatting."
+ echo "You can install it via pip3 install cmake-format"
+fi
+
+echo "Format is ok"
diff --git a/misc/format.sh b/misc/format.sh
index a53acc5e..30892bf5 100755
--- a/misc/format.sh
+++ b/misc/format.sh
@@ -1,2 +1,20 @@
-#!/bin/sh -ex
+#!/bin/sh -e
+
+if [ -n "${VERBOSE}" ]; then
+ set -x
+fi
+
find src unittest -path src/third_party -prune -o -regex ".*\.[ch]p?p?" -exec misc/run-clang-format {} \;
+
+if hash cmake-format 2>/dev/null; then
+ # Top level CMakeLists.txt + subidrectories.
+ # This avoids running the check on any build directories.
+ cmake-format -i CMakeLists.txt
+ find cmake -name "*.cmake" -exec cmake-format -i {} \;
+ find src unittest -name "CMakeLists.txt" -exec cmake-format -i {} \;
+else
+ echo "Note: cmake-format not installed. CMake files will not be formatted."
+ echo "You can install it via pip3 install cmake-format"
+fi
+
+echo "Formating complete"
diff --git a/misc/freebsd/README b/misc/freebsd/README
deleted file mode 100644
index 2faebe6c..00000000
--- a/misc/freebsd/README
+++ /dev/null
@@ -1,12 +0,0 @@
-How to use Vagrant to test ccache on FreeBSD
-============================================
-
-vagrant up
-vagrant ssh
-
-vagrant@freebsd:~ % git clone https://github.com/ccache/ccache.git
-vagrant@freebsd:~ % cd ccache
-vagrant@freebsd:~/ccache % ./autogen.sh
-vagrant@freebsd:~/ccache % ./configure
-vagrant@freebsd:~/ccache % gmake
-vagrant@freebsd:~/ccache % gmake test
diff --git a/misc/freebsd/Vagrantfile b/misc/freebsd/Vagrantfile
deleted file mode 100644
index da126cdc..00000000
--- a/misc/freebsd/Vagrantfile
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-Vagrant.configure("2") do |config|
- config.vm.guest = :freebsd
- config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
- config.vm.box = "freebsd/FreeBSD-12.0-CURRENT"
- config.ssh.shell = "sh"
- config.vm.base_mac = "080027D14C66"
-
- config.vm.provider :virtualbox do |vb|
- vb.customize ["modifyvm", :id, "--memory", "1024"]
- vb.customize ["modifyvm", :id, "--cpus", "1"]
- vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
- vb.customize ["modifyvm", :id, "--audio", "none"]
- vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
- vb.customize ["modifyvm", :id, "--nictype2", "virtio"]
- end
-
- config.vm.provision "shell", inline: <<-SHELL
- pkg install -y git gmake bash autoconf
- SHELL
-end