<div dir="ltr"><div><div><div><div>Would it be feasible for packaging purposes to generate multiple headers, i.e. gen_builder._llvm38.<wbr>hpp, gen_builder_llvm39.hpp, gen_builder_llvm40.hpp, etc. and then have gen_builder.hpp be a stub that just has something like:<br><br></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">#include <llvm.h></span><br><span style="font-family:monospace,monospace"></span><span style="font-family:monospace,monospace">#if llvm_version >= 4.0</span><br><span style="font-family:monospace,monospace">#include "gen_builder_llvm40.hpp"</span><br><span style="font-family:monospace,monospace">#elif llvm_version >= 3.9</span><br><span style="font-family:monospace,monospace">#include "gen_builder_llvm39.hpp"</span><br><span style="font-family:monospace,monospace">#elif llvm_version >= 3.8</span><br><span style="font-family:monospace,monospace">#include "gen_builder_llvm38.hpp"</span><br><span style="font-family:monospace,monospace">#else</span><br><span style="font-family:monospace,monospace"></span></div></div></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">#error llvm version >= 3.8 is required<br></span></div><div><div style="margin-left:40px"><span style="font-family:monospace,monospace">#elif<br><br></span></div>Using the appropriate version checks of course (this is just pseudo code to show the concept)<br></div><div><span style="font-family:monospace,monospace"></span></div><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">----------<br>Chuck Atkins<br>Staff R&D Engineer, Scientific Computing<br>Kitware, Inc.<br><br></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Thu, May 18, 2017 at 2:06 PM, Kai Wasserbäch <span dir="ltr"><<a href="mailto:kai@dev.carbon-project.org" target="_blank">kai@dev.carbon-project.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey,<br>
<span class="">Emil Velikov wrote on 18.05.2017 18:17:<br>
> On 18 May 2017 at 16:34, Rowley, Timothy O <<a href="mailto:timothy.o.rowley@intel.com">timothy.o.rowley@intel.com</a>> wrote:<br>
>> We could use a gen_builder.h generated from llvm-3.9 for all current<br>
>> versions of llvm at this time (as the changes are now just llvm IR<br>
>> additions), but I’m not sure how to enforce that the person creating the<br>
>> tarball has a particular version of llvm installed.<br>
>><br>
> Must admit that I don't know much about LLVM or SWR, so I hope you've<br>
> thoroughly tested LLVM 3.9 generated files built with LLVM 4.0 or<br>
> later.<br>
> Using LLVM 3.9 should be doable, but I'm curious if we can avoid such<br>
> 'acrobatics' in the long run.<br>
><br>
> Any ideas, if that's at all possible?<br>
<br>
</span>how about the SWR maintainers provide a "golden" fallback file, that is<br>
pre-generated and known good for all supported LLVM (right now I would guess<br>
that to be 3.9 and 4.0) versions? That file is always shipped in the tarball.<br>
<br>
During build there's a rule, that checks if $generator is there. If not, the<br>
fallback file is copied to the correct name, otherwise the regular generation<br>
takes place.<br>
<br>
Cheers,<br>
Kai<br>
<br>
<br>______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
<br></blockquote></div><br></div></div>