Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. clangd and Kit Environment Variables
Forum Updated to NodeBB v4.3 + New Features

clangd and Kit Environment Variables

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
2 Posts 1 Posters 217 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Michael Barth
    wrote on 11 Mar 2025, 21:16 last edited by
    #1

    I've set some environment variables, CFLAGS, CXXFLAGS, and so on in the Kit settings under "Environment"

    They look something like CFLAGS=-mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/redacted/path

    Everything builds beautifully and the generated makefiles look correct. However, there seems to be some kind of an issue with the way Qt Creator is passing these arguments to my GCC when it's trying to dump info for clangd.

    If I run qtcreator from the terminal, I can see the following output:

    SOFT ASSERT [17:02:30.451]: /home/qt/work/build/qt-creator/src/plugins/projectexplorer/gcctoolchain.cpp:625: Compiler feature detection failure.
    The command "/redacted-path/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -x c -E -dM '-mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/redacted/path' -D_REENTRANT -" terminated with exit code 1.
    arm-poky-linux-gnueabi-gcc: error: unrecognized command-line option ‘-mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/redacted/path’
    

    As you can see, it's passing all of the arguments in single quotes, so it thinks of it as one giant argument.

    How do I get it to NOT do that?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Michael Barth
      wrote on 12 Mar 2025, 14:49 last edited by
      #2

      To answer my own question, I was setting OE_QMAKE_CFLAGS and OE_QMAKE_CXXFLAGS with those values. This appears to be what it was pulling from.

      By removing these and instead moving it to the Platform codegen flags and Platform linker flags for the compiler settings, I seem to achieve the result that I want.

      It's a little more duplication than I would want, but it is functional.

      1 Reply Last reply
      0
      • M Michael Barth has marked this topic as solved on 12 Mar 2025, 14:59

      1/2

      11 Mar 2025, 21:16

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved