rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.79k stars 314 forks source link

Empty compilation database for XC8 #403

Closed SamuelYvon closed 3 years ago

SamuelYvon commented 3 years ago

Describe the bug Using bear -- make on a Microchip PIC project (8 bit MCU) creates an empty compilation database.

To Reproduce

An (almost) empty XC8 project will not work.

Expected behavior

A non-empty compilation database.

Environment:

Additional context

Here is my config file. I could not find a full example of the config file, so I am not sure if this works or is valid syntax. I opened issue #402 because I also cannot see what bear sees my config as.

> cat ~/.config/bear.conf
strategy:
  append_to_existing: false
  include_headers: false
  include_linking: false
  compilers: 
      languages:
        c++:
          - g++
          - clang++
        c:
          - gcc
          - clang
          - xc8-cc
          - xc8
          - "/opt/microchip/xc8/v2.32/bin/xc8-cc"
        mpi:
          - mpiCC
          - mpicc
          - mpicxx
          - mpic++
        wrapper:
          - distcc
          - ccache

Before you send...

rizsotto commented 3 years ago

Hey @SamuelYvon , thanks for the report. The first thing I've noticed that the config file is written in YAML, but the current Bear version is only able to read JSON file. (The config file is documented in the citnames command's man page.)

SamuelYvon commented 3 years ago

Thanks! It generated a compile_commands.json file properly. While it does not work with ccls, I don't think it's an issue with bear. As a note, I spotted in man bear that it says citnames contains the config template, so this is on me.