Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
1.2.0
-
None
Description
Modules may contribute include paths to a Product's build.
however, with some bad luck, the addition of a path may lead to a source including a wrong header, or the wrong version of it. this is particularly likely when an external module adds a path which is shared with other modules, or a path that contains a different version of a Module which is also part of the project.
to avoid this situation, qbs should order the include paths in a way which ensures that the right headers are found first. if such an arrangement is impossible, it should error out.
obviously, to identify conflicts, qbs needs some "sentinels". these should be specific headers which are deemed likely (or are known) to cause conflicts, e.g. config.h and such.
a particularly elaborate syntax would look like this:
headers: "/opt/foolib/include//foo//{config.h,global.h}"
which would be processed into:
// this is actually added includePaths: [ "/opt/foolib/include", "/opt/foolib/include/foo" ] // _other_ include paths are checked for these includeSentinels: [ "config.h", "global.h", "foo/config.h", "foo/global.h" ]
the second form is less magic, but also more verbose.