Commit Graph

70 Commits

Author SHA1 Message Date
Fangrui Song
53134b679c Simplify wscript and remove -x c++-header 2018-01-08 20:55:09 -08:00
Fangrui Song
a3a89af14f waf configure --use-system-clang, prefer bld.env.get_flat('CXX') over clang inferred from llvm-config'
Fixes #237. Credit to @acowley
2018-01-07 22:10:37 -08:00
Fangrui Song
cef1559f6d Fix waf configure --variant=debug on Linux 2018-01-07 15:18:01 -08:00
Jacob Dufault
b2e2d4fcbb Windows fixes for wscript
- Use /MD, otherwise cquery will crash when trying to use C library.
- Fix build when symlink fails
2018-01-07 02:10:09 -08:00
Fangrui Song
3f1cb5c072 Add submodule https://github.com/msgpack/msgpack-c and make Serialize/Deserialize aware of SerializeFormat 2018-01-06 15:29:53 -08:00
Fangrui Song
18e3f56d0c [waf] Fix build on OpenIndiana 2018-01-04 20:24:44 -08:00
Fangrui Song
cd3faf4dfe [waf] Add test rax,rax -> test r8,r8 patch for --bundled-clang={4.0.0,5.0.1} on Linux 2018-01-03 18:36:07 -08:00
Fangrui Song
a0c6435ff4 [waf] -fno-rtti -Wno-comment -DLOGURU_RTTI=0 for --use-clang-cxx 2018-01-03 09:05:58 -08:00
scturtle
f23a79b01d [travis] Retry. (#221) 2018-01-02 22:25:06 -08:00
Fangrui Song
c8040a3b9e [travis] Make travis faster 2018-01-02 21:57:15 -08:00
Fangrui Song
2830548768 [waf] Prep for travis cache directories 2018-01-02 20:35:40 -08:00
Chao Shen
c157445ef3 fix ci 2018-01-02 09:11:34 -06:00
Fangrui Song
7529973014 [formatting] Change linking order 2017-12-31 14:23:49 -08:00
Daniel Martín
f389d294b7 Protect formatting code inside USE_CLANG_CXX 2017-12-31 23:15:03 +01:00
Daniel Martín
19341c18cd Basic implementation of document formatting
Still some important TODOs to address:

- Improve the algorithm that converts between offsets and line/column
  pairs. Right now it's extremely naive.
- Add proper support for a .clang-format file that specifies
  the coding style.
2017-12-31 13:30:34 +01:00
scturtle
ffd5fc3e38 Fix extracting the tarball every time. (#207) (#208) 2017-12-30 23:35:40 -08:00
Fangrui Song
01290a83c5 [waf] Fix --bundled-clang=5.0.1 on Mac OS X (#207) 2017-12-30 22:07:05 -08:00
Fangrui Song
8592df7cf6 Use --bundled-clang=5.0.1 by default (instead of 4.0.0) 2017-12-29 10:40:29 -08:00
Fangrui Song
d4ce12bb9a Add --use-clang-cxx to waf and move type printer to src/type_printer.cc
src/type_printer.cc demonstrates how to leverage clang C++ API.
It includes clang/**/*.h headers and CXTranslationUnit.h which resides
in clang/tools/libclang/ but is not exposed in clang/include/clang-c/

These libclang/ header files are stable and provide some struct definitions used by clang-c/ header files.
A copy of them from clang source tree is checked into libclang/ .

If you want to an early adopter,
CXXFLAGS='-std=c++11 -fno-rtti -D_GLIBCXX_USE_CXX11_ABI=0 -g' ./waf configure --variant=cxx-debug --bundled-clang=5.0.1 --use-clang-cxx

Some clang/**/*.h are unstable and should be used with caution,
in addition, Windows pre-built binaries on https://releases.llvm.org/download.html do not include C++ header files.
Thus `--use-clang-cxx` defaults to False.
2017-12-29 09:51:26 -08:00
Fangrui Song
fd264310c2 [waf] Add -std=c++11 when CXXFLAGS is specified without -std= setting 2017-12-28 22:23:59 -08:00
Fangrui Song
5029173c8a [waf] Add --use-clang-cxx in prep for using clang C++ API 2017-12-28 21:42:33 -08:00
Fangrui Song
3c6cf1017c [waf] Make --llvm-config set RPATH and detect clang resource dir with $(llvm-config --bindir)/clang (#196) 2017-12-27 14:52:32 -08:00
Fangrui Song
338db49637 [waf] Add --variant=asan (#186) 2017-12-24 16:24:26 -08:00
Riatre Foo
9362b4539f Fix symlink creation on Windows. 2017-12-23 11:16:48 -08:00
Riatre Foo
1056869ffa Remove dependency on builtin clang_resource_dir. 2017-12-23 11:16:44 -08:00
Fangrui Song
ca02ee4339 [waf] Support --bundled-clang=5.0.1 2017-12-21 18:52:16 -08:00
Fangrui Song
1dfa88ed1c Update third_party dependencies to FreeBSD buildable versions
The latest sparsepp and loguru build on FreeBSD:

605ebb9534
c3f5b43206
2017-12-19 20:24:41 -08:00
Fangrui Song
0cf54f3557 [waf] Fix ./waf configure --bundled-clang=5.0.0 2017-12-18 13:30:57 -08:00
Joel Hock
934c20312a set rpath for mac when --use-system-clang 2017-12-17 21:18:38 -08:00
Fangrui Song
2fb135e10a Support FreeBSD
This commit fixes issue on cquery's side. Its dependencies loguru and
sparsepp should also be ported to FreeBSD:

* https://github.com/emilk/loguru/pull/46
* sysinfo(2) called by sparsepp https://github.com/greg7mdp/sparsepp/blob/master/sparsepp/spp_memory.h#L32
2017-12-17 16:44:21 -08:00
Riatre Foo
0045e4817c Windows build script (#154)
* Cast from float explicitly.

* Upgrades to waf 2.0.2.

For VS2017 support on Windows.

* [waf] Supports building on Windows.

Needs 7z.exe in PATH for extracting prebuilt clang NSIS installer (when
using bundled clang).
RPATH is "emulated" by putting a libclang.dll alongside the cquery
binary.
Tested with Visual Studio 2017 toolchain.

* [waf] Fix default_resource_directory on Windows + system clang.

* Add AppVeyor configuration
2017-12-17 10:14:30 -08:00
Fangrui Song
0a8ea0e51f Honor environment variable CXXFLAGS and tweak README (#153)
Also loosen rsync `-a` option to `-rt`
2017-12-16 19:39:51 -08:00
DaanDeMeyer
97da6c937a Remove sparsehash from wscript 2017-12-16 09:39:36 -08:00
Fangrui Song
ea5c89e956 [waf] Use {str,bytes}.decode to make it compatible with Python 2/3 2017-12-14 21:35:25 -08:00
Fangrui Song
044ef0b309 [waf] Install resource dir to $PREFIX (#139) 2017-12-14 17:45:15 -08:00
Chen
f3f7bc26cd Better default resource dir heuristics: use system resource dir with system clang and relative path to resource dir with bundled clang (#137) 2017-12-14 14:35:21 -08:00
Fangrui Song
d8b47ebdd4 [waf] Use RPATH $ORIGIN on FreeBSD/Linux and copy libclang.so.[4-9] to $PREFIX/lib/clang+llvm*/lib/ (#133)
Also copy build/release/lib/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/lib/clang/5.0.0/include/* to $PREFIX/lib/clang+llvm*/resource-dir/include/
2017-12-13 10:53:42 -08:00
Fangrui Song
cb633541e2 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
2017-12-12 00:07:38 -08:00
Fangrui Song
60febe6e9d [waf] Add --variant={debug,release} (#129)
./waf build => build/app
./waf build --variant=debug => build/debug/app
./waf build --variant=release => build/release/app

TODO Make --variant default to 'release', rename `app` to `bin/cquery`, and disallow empty variant
2017-12-11 20:36:53 -08:00
Jacob Dufault
07c0ae109e Fix waf build 2017-12-05 00:05:08 -08:00
Fangrui Song
3ca2d0f2ad waf configure --bundled-clang=5.0.0 to use prebuilt clang+llvm 5.0.0, fixes #41 2017-11-29 11:12:45 -08:00
Jacob Dufault
7923b5d219 Revert "Upgrade bundled clang+llvm to 5.0.0, fixes #41"
This reverts commit 162c4e8198bbae2a1ef52b764a365d7b92b8f81e.
2017-11-27 08:40:06 -08:00
Fangrui Song
7df44f75a7 Upgrade bundled clang+llvm to 5.0.0, fixes #41 2017-11-27 11:13:32 -05:00
Fangrui Song
8aaffb7031 Set rpath if not --use_system_clang 2017-11-26 15:15:05 -05:00
xbreak
972a6359da Added waf options to use clang from system (fixes #36): (#64)
- `--use-system-clang` enables use of system clang.
 - `--llvm-config=LLVM_CONFIG` specifies which llvm-config to use.
 - `--clang-prefix=CLANG_PREFIX` specifies the clang prefix to use as
   a fallback if llvm-config is not available.
2017-11-26 12:13:43 -05:00
Fangrui Song
7d06ff212f Use -Wno-sign-compare to make recent GCC happy 2017-11-22 10:42:04 -05:00
DaanDeMeyer
030e63f15c Remove whitespace before shebang in wscript
This makes the python extension in vscode recognize it as a python file
2017-11-20 17:14:24 -05:00
Daan De Meyer
424c7b69db Fix wscript to support both Python 2 and Python 3. 2017-11-19 13:03:40 -05:00
Jacob Dufault
544818bdd4 waf: Only compile cc files in src/ 2017-11-18 09:27:09 -08:00
Jacob Dufault
c5651a1dbf Revert to clang4 2017-09-25 14:32:45 -07:00