summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2015-02-05 21:00:23 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2015-02-05 21:06:34 +0100
commitf8d7756a14a8073f24c31b3854b7e64784cbb002 (patch)
tree9ff4561f0064265b98a88abd35cd70f3b9a3fc03 /wscript
parentc5f1391ebbd6d947324aa59ab0ba5240bcbcefea (diff)
downloadmpv-f8d7756a14a8073f24c31b3854b7e64784cbb002.tar.bz2
mpv-f8d7756a14a8073f24c31b3854b7e64784cbb002.tar.xz
build: add option to generate a clang compilation database
The compilation database is a JSON file[1] storing all compilation flags. That is useful for tools using libclang for code completion and error reporting (for example: YouCompleteMe for vim). [1]: http://clang.llvm.org/docs/JSONCompilationDatabase.html
Diffstat (limited to 'wscript')
-rw-r--r--wscript8
1 files changed, 8 insertions, 0 deletions
diff --git a/wscript b/wscript
index cb12a3e37d..8f3961cf97 100644
--- a/wscript
+++ b/wscript
@@ -84,6 +84,11 @@ build_options = [
'name': '--test',
'desc': 'test suite (using cmocka)',
'func': check_pkg_config('cmocka >= 0.4.1'),
+ }, {
+ 'name': '--clang-database',
+ 'desc': 'generate a clang compilation database',
+ 'func': check_true,
+ 'default': 'disable',
}
]
@@ -891,6 +896,9 @@ def configure(ctx):
if not ctx.dependency_satisfied('build-date'):
ctx.env.CFLAGS += ['-DNO_BUILD_TIMESTAMPS']
+ if ctx.dependency_satisfied('clang-database'):
+ ctx.load('clang_compilation_database')
+
ctx.store_dependencies_lists()
def build(ctx):