cloudflare/ClickHouse
Publicmirrored fromhttps://github.com/cloudflare/ClickHouse
ci/check-syntax.sh
20lines · modecode
8 years ago
| 1 | #!/usr/bin/env bash |
| 2 | set -e -x |
| 3 | |
| 4 | source default-config |
| 5 | |
| 6 | ./install-os-packages.sh jq |
| 7 | |
| 8 | [[ -d "${WORKSPACE}/sources" ]] || die "Run get-sources.sh first" |
| 9 | |
| 10 | mkdir -p "${WORKSPACE}/build" |
| 11 | pushd "${WORKSPACE}/build" |
| 12 | |
| 13 | cmake -DCMAKE_BUILD_TYPE=Debug $CMAKE_FLAGS ../sources |
| 14 | |
| 15 | make -j $THREADS re2_st # Generated headers |
| 16 | |
| 17 | jq --raw-output '.[] | .command' compile_commands.json | grep -v -P -- '-c .+/contrib/' | sed -r -e 's/-o\s+\S+/-fsyntax-only/' > syntax-commands |
| 18 | xargs --arg-file=syntax-commands --max-procs=$THREADS --replace /bin/sh -c "{}" |
| 19 | |
| 20 | popd |