[Mesa-dev] [PATCH v4 0/2] build system: Unify c++11 detection and used [was: configure+mesa/st:check -std=c++11 support and enable tests accordingly]
Emil Velikov
emil.l.velikov at gmail.com
Mon Oct 16 13:26:05 UTC 2017
On 14 October 2017 at 11:12, Gert Wollny <gw.fossdev at gmail.com> wrote:
> Hi Emil,
>
> regarding this patch, I now think we can indeed drop the second part
> (the one that adds the g++4.4 test), because it would only check
> whether one sets the -std=c++11 flag somewhere accidently. Checking
> that no c++11 code makes it into core mesa is already happening as long
> as travis uses a pre g++6 compiler.
>
> Considerig the choice between checking for support of the flag
> -std=c++11 and checking whether the compiler supports c++11 features by
> default the discussion on debian-devel started by this mail
>
> https://lists.debian.org/debian-devel/2017/10/msg00174.html
>
> might be of interest. In short it is preferred that the code is
> compiled with the standard the compiler sets by default. From that
> point of view the version of the patch that checks for the features
> would be better, or I could rework the patch to check whether g++ is
>>= 6.0, but that is, of course, not as generic.
>
> Another consideration is that with g++ >= 6 with the current approach
> of setting the flags we end up with the somewhat paradox situation
> where the "more modern" code requiring -std=c++11 is compiled like
> this, but the "older" code is compiled with the default, newer, c++14,
> so no setting flags unless it is really needed would IMHO be more
> consistent.
>
Gert, I believe that you can see why using C++ code (or tinkering with
its flags) is not as easy task.
In Mesa context at least - a low level library used by dozens if not
hundreds of other components.
Sure there's plenty of existing C++ code around, which doesn't help.
That aside:
I think that using the -std=c++11 check should be good, one small
nitpick though.
Please keep the different Mesa components as separate patches.
In semi-random order:
1) generic check in configure
2) use in swr (maybe squash with 1?)
3) use in clover
4) use in st/mesa/tests
5) Travis build target (not 100% sure it's worth having but meh)
Thanks
Emil
More information about the mesa-dev
mailing list