Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Project setup examples

Daan De Meyer edited this page Jul 28, 2018 · 3 revisions

.cquery

Include paths

include/a.h:

int bad;

a.cc:

int main(){return bad;}

.cquery:

%clang %cpp -std=gnu++14 -Iinclude cquery will save a file in cacheDirectory: jq . < /tmp/cquery/@tmp@c/a.cc.json

15
{
  "last_modification_time": 1520737513,
  "language": 1,
  "import_file": "/tmp/c/a.cc",
  "args": [
    "clang++",
    "-working-directory=/tmp/c",
    "-std=gnu++14",
    "-Iinclude",
    "/tmp/c/a.cc",
    "-resource-dir=/home/maskray/Dev/Util/cquery/build/debug/lib/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-14.04/lib/clang/6.0.0",
    "-Wno-unknown-warning-option",
    "-fparse-all-comments"
  ],
  "includes": [
    {
      "line": 0,
      "resolved_path": "/tmp/c/include/a.h"
    }
  ],
  "dependencies": [
    "/tmp/c/include/a.h"
  ],
  ...

cross-compiled project using the GNU Arm embedded toolchain

Include paths

C

/usr/bin/../lib/gcc/arm-none-eabi/7.2.1/include
/usr/bin/../lib/gcc/arm-none-eabi/7.2.1/include-fixed
/usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include

C++

/usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/c++/7.2.1
/usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/c++/7.2.1/arm-none-eabi/thumb/v7-ar/fpv3/softfp
/usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/c++/7.2.1/backward
/usr/bin/../lib/gcc/arm-none-eabi/7.2.1/include
/usr/bin/../lib/gcc/arm-none-eabi/7.2.1/include-fixed
/usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include

Notes:

  • If you use a Makefile and have generated a compile_commands.json file from it (see compile_commands.json), the include path fields in your compilation database may have been automatically populated. In this case, you shouldn't need to do anything more.
  • The GCC version number (listed above as 7.2.1) may vary based on platform and toolchain version. You can find out what version you have by running arm-none-eabi-gcc --version and substitute the listed value for the version in the include path.
  • /usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/c++/7.2.1/arm-none-eabi/thumb/v7-ar/fpv3/softfp may vary based on the architecture for which you are compiling.
  • On Windows, the path /usr/bin/../ is the root directory of wherever you installed the toolchain (so it should have the folders arm-none-eabi, bin, lib, and share, as well as an uninstall executable).
  • If you are unable to index files, check that cquery is not trying to build your files with Microsoft extensions (see cquery-project/cquery#509)