[SOLVED] Clang compilation database

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Clang compilation database

    We're trying to get the -MJ compilation database option to work when using clang as the compiler. I've tried a few variations but always get error: unknown argument. I've also tried wrapping with the -Xclang option but no luck.

    The incantation looks like this

    $SEGGER_PATH/llvm/bin/clang -cc1 [options] [file] -MJ file.o.json

    Has anyone been able to make this work? I'm wondering what the cc1 option does since it does not appear in the --help menu.
  • Hello,

    Thank you for your inquiry.
    In ES the clang driver isn't used, the compiler is called directly.
    What exactly is the setup you are trying to achieve here with CL option -MJ?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello, thanks for that information.

    We were trying to get ES to automatically generate the compilation database for us via Clang. The intention was to use that to feed clang-tidy but we've since decided to make the operation a task outside of ES.
  • Hello,

    Thank you for clarification.
    For easier project management external toolchains can also be called from within Embedded Studio:
    wiki.segger.com/SEGGER_Embedde…hain_with_Embedded_Studio

    Maybe that helps?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.