cmake: Add clint target to build Makefile

Allows linting only modified files and linting multiple files in
parallel. In the current state is rather slow because errors.json is
a 6 MiB file and needs to be reparsed each time.

Results on my system (6-core):

    # In build dir, actually parallel
    make -j5 clint  241.24s user 8.39s system 334% cpu 1:14.74 total
    # In root, one process
    make -j5 clint  60.69s user 0.37s system 93% cpu 1:05.19 total

In both cases download time included.

That is not well for travis (though I would keep travis as-is because
new variant will fail before checking all files), but already good
enough for regular development: total times are nearly identical and
this is the *full* build, further `make -C build clint` will check only
modified files.
This commit is contained in:
ZyX
2017-03-31 10:51:41 +03:00
parent a1c928e70c
commit 030c0588a0
2 changed files with 93 additions and 55 deletions

1
cmake/Download.cmake Normal file
View File

@@ -0,0 +1 @@
file(DOWNLOAD "${URL}" "${FILE}")