[cfe-dev] Adding a framework to a CompilerInvocation
Félix Cloutier via cfe-dev
cfe-dev at lists.llvm.org
Thu Jan 12 08:24:19 PST 2017
Hi Alex,
To be clear, I’m looking for the equivalent to the -framework parameter. -F is the search path for -framework.
Porting the code over to build an invocation through command-line arguments would be a possibility, then. I’d still like to know if there’s another way, as I’m under the impression that this other way should be simpler.
Félix
> Le 12 janv. 2017 à 02:25, Alex L <arphaman at gmail.com> a écrit :
>
> Hi Felix,
>
> The framework search path options (that correspond to -F) are stored in an instance of the HeaderSearchOptions class inside the CompilerInvocationBase class, and you can add an new -F search path using the AddPath method.
>
> On 12 January 2017 at 07:35, Félix Cloutier via cfe-dev <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
> Hi all,
>
> I have code that builds a CompilerInvocation with the Clang static libraries. I would like to tell that invocation to use specific frameworks, just like using the -framework Clang front-end option. In particular, I'm looking for these "side effects" of using a framework:
> the compiler locates the framework on the system from its name using the framework search path;
> the compiler knows where to find framework headers identified through a path like <Framework/Header.h>.
> At this point, I think that I've looked everywhere in the option sub-objects of the CompilerInvocation class, and the closest thing that I can identify related to that is the header search path. I can't seem to find a way to tell the CompilerInvocation to look for a specific framework.
>
> How is that supposed to happen? I'm using a manually-built CompilerInvocation instead of building it through command-line arguments because that seems to be the only way to pass a memory buffer as a source unit instead of a file.
>
> I think you can still use the memory buffer as source even if you create the invocation using command line arguments if you remap the buffer to the filename after creating the invocation (addRemappedFile in PreprocessorOptions).
>
> Alex
>
>
> Thanks!
>
> Félix
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170112/8882d512/attachment.html>
More information about the cfe-dev
mailing list