Review Request 128272: support -iframework and -F header search path options
René J.V. Bertin
rjvbertin at gmail.com
Sat Jun 25 11:41:22 UTC 2016
This is an automatically generated e-mail. To reply, visit:
(Updated June 25, 2016, 1:41 p.m.)
Review request for KDE Software on Mac OS X and KDevelop.
This is the first working prototype. After all the trivial-but-tedious changes it was almost an anticlimax to see it work.
I don't really understand but it turns out to be necessary to add the system framework paths explicitly (`/Library/Frameworks` and `/System/Library/Frameworks`, in that order). Clang searches there by default when used as a compiler, but apparently it does not when used for parsing. To avoid yet more duplicatin I've implemented that default path via a `ClangParsingEnvironment` ctor, but only on OS X.
System SDK header files are now found in the default locations, which isn't necessarily the absolutely correct place to search. For parsing it ought to do most of the time but support for the `-isysroot` argument will need to be considered as a future modification (= a priori as a separate patch after committing and testing the current patch in the wild).
This is a draft implementation for parser support of the `-iframework dir` and `-F dir` compiler arguments. On OS X these are the framework equivalents of `-isystem` and `-I` respectively, telling the compiler and/or linker where to find framework bundles.
I started out making the new code available on OS X only but that introduces a lot of #ifdefs for probably little benefit. On the contrary, clang supports the arguments on Linux too, presumably because clang is a functional cross-compiler that can generate Darwin Mach-O object files on Linux too.
For the 1st approach I propose to parse the framework directories, adding the effective header directories of the individual frameworks as if they were added explicitly. The framework directories are also added to a new list in the result structure. I presume that this is a prerequisite for adding them to the (lib)clang arguments of the clang parser.
the unittest works as expected on OS X.
20160625: the patch works as expected on OS X. The `-iframework /opt/local/libexec/qt5/Library/Frameworks` argument added by cmake to each compiler invocation is detected and put to use; Qt header files are found in the frameworks without a wrapper Qt5 header directory (`/opt/local/include/qt5`) added to the header search path. Header files from the system SDKs are found too
the real companion patch for kdevplatform
René J.V. Bertin
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel