[Scons-users] How to check if the C++ compiler supports `override`?

Mark A. Flacy mflacy at verizon.net
Mon Aug 4 16:36:09 EDT 2014


On Monday, August 04, 2014 09:06:35 PM Carsten Fuchs wrote:
> Hi all,
> 
> sorry if this is a trivial question, but I couldn't find the answer in
> the manual or in the man page:
> 
> How can I find out (in the SConstruct script) if the (Linux) C++
> compiler supports the `override` identifier?

http://www.scons.org/doc/production/HTML/scons-user.html#idp24303632

Pretty much the same way that autoconf would; try a test compile to see.

> 
> The only C++ compilers that I support in my project are Visual C++ 2005
> (VC8) and newer under Windows, all of which support the `override`
> specifier, and g++ under Linux, which supports `override` only in
> version 4.7 and newer. However, Ubuntu 12.04 still comes with g++ 4.6,
> which I would like to support for quite a while.
> 
> So for the g++ compiler versions, my initial plan was to check if the
> CXXVERSION variable of the SCons environment matches the required
> version (which in turn requires some parsing of the version string), but
> I was wondering if there is a better solution to this problem? For
> example, can I check for the `override` identifier in a more direct
> manner than only via the compiler version?
> 
> Any hints and help would much be appreciated!  :-)
> 
> Best regards,
> Carsten
> 
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
-- 
Mark A. Flacy


More information about the Scons-users mailing list