From cb633541e2ce777a4e0bd722d6964ce226e55284 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 11 Dec 2017 21:14:13 -0800 Subject: [PATCH] Change default path of built executable from build/app to build/release/bin/cquery (installed to $PREFIX/bin/cquery) This is incompatible, please change your editor configuration: * LanguageClient-neovim: g:LanguageClient_serverCommands * Emacs cquery.el: cquery-executable * VSCode: cquery.launch.workingDirectory cquery.launch.command --- README.md | 13 ++++++++++++- wscript | 5 ++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8bccf188..41c911b5 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,19 @@ Building cquery is simple. The external dependencies are few: $ clang --version # if missing, sudo apt-get install clang $ git clone https://github.com/jacobdufault/cquery --recursive $ cd cquery -$ ./waf configure +$ ./waf configure --prefix ~/.local/stow/cquery $ ./waf build +# -g -O3, built build/release/bin/cquery +$ ./waf install +# optional, copies the executable to $PREFIX/bin/cquery +``` + +For a debug build: + +```bash +$ ./waf configure --variant=debug +$ ./waf build --variant=debug +# -g -O0, built build/debug/bin/cquery ``` ## Install extension diff --git a/wscript b/wscript index a5b8343c..e5b3de3f 100644 --- a/wscript +++ b/wscript @@ -50,8 +50,7 @@ def options(opt): help='specify path to llvm-config for automatic configuration [default: %default]') grp.add_option('--clang-prefix', dest='clang_prefix', default='', help='enable fallback configuration method by specifying a clang installation prefix (e.g. /opt/llvm)') - # TODO Default to 'release' and disallow empty variant - grp.add_option('--variant', default='', + grp.add_option('--variant', default='release', help='variant name for saving configuration and build results. Variants other than "debug" turn on -O3') def download_and_extract(destdir, url): @@ -199,7 +198,7 @@ def build(bld): defines=['LOGURU_WITH_STREAMS=1'], lib=lib, rpath=[] if bld.env['use_system_clang'] else bld.env['LIBPATH_clang'], - target='app') + target='bin/cquery') #bld.shlib(source='a.cpp', target='mylib', vnum='9.8.7') #bld.shlib(source='a.cpp', target='mylib2', vnum='9.8.7', cnum='9.8')