Closed jim-bcom closed 1 year ago
bug reproduced with :
The next release of builddefs-qmake 4.10.0 apparently no longer has this problem.
Management of INCLUDEPATH/QMAKE_CXXFLAGS has changed in packagedependencies-parser.pri
.
Generic separation of INCLUDE_PATH and QMAKE_CXXFLAGS has bee replaced by new pkgconfig commands for getting only concerned parameters :
PKGCFG_INCLUDE_PATH = $$system(pkg-config --cflags-only-I $$pkgCfgVars $$pkgCfgFilePath)
# disable external/system warnings
contains(DEPENDENCIESCONFIG,externaldeps)|contains(CONFIG,externaldeps)|contains(REMAKENCONFIG,externaldeps) {
win32{
QMAKE_CXXFLAGS += $$replace(PKGCFG_INCLUDE_PATH, -I," /external:I ")
} else {
QMAKE_CXXFLAGS += $$replace(PKGCFG_INCLUDE_PATH, -I, -isystem)
}
} else {
INCLUDEPATH += $$replace(PKGCFG_INCLUDE_PATH, -I, "")
}
QMAKE_CXXFLAGS += $$system(pkg-config --cflags-only-other $$pkgCfgVars $$pkgCfgFilePath)
NB : this code also handles removing warnings from external libraries with externaldeps config flag
I advise to delete the build folder so that the project is reindexed entirely with clang.
fix will be available in builddefs/qmake 4.10.0
available in release 4.10.0
external Deps is incompatible with removing clangd errors when indexing on Windows Ok on Linux
tested with SolarFramework branch develop
HOW TO REPRODUCE Open a SolAR project, for example this one (the following examples are not from this project).
EXPECTED BEHAVIOR
OBSERVED BEHAVIOR
This makes QtCreator barely usable as we lose all completion and code navigation for our project dependencies.
SOME LEADS INCLUDEPATH is built in
packagedependencies-parser.pri
.I've tried several things. For example, with a missing reference to xpcf library:
INCLUDEPATH += /home/user/.remaken/packages/linux-gcc/xpcf/2.5.0/interfaces
before and after the loop: it works, errors are gone$$shell_quote($$replace($$eval(var), -I,))
in a variable FOO and assign FOO to INCLUDEPATH after the loop: does not workI thought that some kind of special character might have been inserted by the loop in the list, so I've checked that every entry of that list is an existing file
All files do exist, all right:
So I tried to include those path to INCLUDEPATH:
Does not work.
I've tried to add the hard-coded path in the loop
Does not work.
But if I add a hard-coded path after the loop, it works:
It seems to behave as if the the concatenation in a for loop does not work.
CONFIGURATION OS: Windows 10 / gnu-Linux-Ubuntu 18.04 QtCreator 4.14.0 Qt: 5.15.2 MSVC 2019
QtCreator is an old version. I keep it to avoid regression issues I already encountered by upgrading. But this might be fixed in latest releases, I haven't tested it.