[cfe-dev] Clang to find its own headers

Ilya Biryukov via cfe-dev cfe-dev at lists.llvm.org
Fri Jan 11 12:45:31 PST 2019


If it's possible to change the distribution, I would suggest keeping the
directory structure that clang expects, though.
This would allow to be consistent with how other distributions (Chromium's
clang, LLVM releases) do that, allowing to swap clang compiled for those
when needed.

On Thu, Jan 10, 2019 at 5:36 PM Petr Hosek via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> The CMake variable is called CLANG_RESOURCE_DIR, defined here:
>
> https://github.com/llvm-mirror/clang/blob/master/CMakeLists.txt#L217
>
> If unset, the driver computes the path:
>
> https://github.com/llvm-mirror/clang/blob/master/lib/Driver/Driver.cpp#L121
>
> On Thu, Jan 10, 2019 at 6:45 AM Máté Ferenc Nagy-Egri via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> It might be true. clang.exe resides in
>>
>>
>>
>> <vcpkg_root>/installed/<triplet>/tools/llvm/
>>
>>
>>
>> whereas the includes are in
>>
>>
>>
>> <vcpkg_root>/installed/<triplet>/lib/clang/<version>/include
>>
>>
>>
>> so the way to reach them is ../../lib/clang/<version>/include
>>
>>
>>
>> Can I change this with configuring Clang? I don’t see any CMake param to
>> LLVM that would controll this. Is this hardcoded? Where must I patch it?
>>
>>
>>
>> *Feladó: *Kim Gräsman via cfe-dev [via Clang Developers]
>> <ml+s42468n4063493h51 at n3.nabble.com>
>> *Elküldve: *2019. január 10., csütörtök 11:58
>> *Címzett: *Meteorhead <csiga.biga at aol.com>
>> *Tárgy: *Re: Clang to find its own headers
>>
>>
>>
>> On 2019-01-10 11:27, Máté Ferenc Nagy-Egri via cfe-dev wrote:
>>
>>
>> > Hi!
>> >
>> > Forgive my noobish question, I’m new to actually touching the
>> Clang/LLVM
>> > codebase.
>> >
>> > Where is it coded how Clang finds its own headers from under
>> > ’lib/clang/7.0.0/include’? I’m helping with the packaging of LLVM
>> on
>> > Windows for Vcpkg and the resulting Clang install doesn’t work, it
>> fails
>> > to finds its own headers. Are Clang installs relocatable? Vcpkg builds
>> > packages out of source into a staging directory. If both Debug and
>> > Release builds go fine, it does a few extra checks and copies the
>> result
>> > of the ’install’ target which went to the staging dir to its final
>> > location. I don’t know if this workflow causes the problem or the
>> layout
>> > is different than what Clang would expect.
>>
>>
>> On Posix Clang expects the internal include files to be present relative
>> to the binary: ../lib/clang/<version>/include. Where "<version>" is the
>> version of Clang. Not sure if the same is true on Windows.
>>
>> --
>> /Jacob Carlborg
>>
>> _______________________________________________
>> cfe-dev mailing list
>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4063493&i=0>
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>> *If you reply to this email, your message will be added to the discussion
>> below:*
>>
>>
>> http://clang-developers.42468.n3.nabble.com/Clang-to-find-its-own-headers-tp4063492p4063493.html
>>
>> To start a new topic under Clang Developers, email
>> ml+s42468n42468h76 at n3.nabble.com
>> To unsubscribe from Clang Developers, click here
>> <http://clang-developers.42468.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=42468&code=Y3NpZ2EuYmlnYUBhb2wuY29tfDQyNDY4fC0yMDA4MDczOTM3>
>> .
>> NAML
>> <http://clang-developers.42468.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>


-- 
Regards,
Ilya Biryukov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190111/440eb9c2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 457F57AC99784404B0EFAE4997925A28.png
Type: image/png
Size: 148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190111/440eb9c2/attachment-0001.png>


More information about the cfe-dev mailing list