[Scons-users] Support of the isystem option for gcc
William Blevins
wblevins001 at gmail.com
Tue Oct 14 18:59:27 EDT 2014
Paul,
A gracious individual already submitted a patch for -isystem support, and
it has been merged into the trunk, but that patch did not make the 2.3.4
release.
Please see
https://bitbucket.org/scons/scons/pull-request/184/support-isystem-in-parseflags/diff
and let us know if this also solves this issue.
V/R,
William
On Tue, Oct 14, 2014 at 9:37 AM, Paul Grégoire <pg.ensiie at gmail.com> wrote:
> Hello,
>
> I recently discovered SCons and I really think this is an amazing tool
> for building software.
>
> To build my project, I recently need to use "isystem" option of GCC.
> This option is not currently supported by SCons. So I tried to
> implement it with the help of Dirkbaechle
> (
> http://stackoverflow.com/questions/25850762/scons-how-to-add-search-directories-to-an-existing-scanner
> ).
> Dirkbaechle suggested posting my solution here.
>
> I have implemented the solution like this :
>
>
> #### Add support for system headers
> # declare and use a new PATH variable for system headers : CPPSYSTEMPATH
> env['CPPSYSTEMPATH'] = []
> env['SYSTEMINCPREFIX'] = '-isystem '
> env['SYSTEMINCSUFFIX'] = ''
> env['_CPPSYSTEMINCFLAGS'] = '$( ${_concat(SYSTEMINCPREFIX,
> CPPSYSTEMPATH, SYSTEMINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
> env['_CCCOMCOM'] += ' $_CPPSYSTEMINCFLAGS'
> # add this variable to the C scanner search path
> env['_CPPPATHS'] = ['$CPPPATH', '$CPPSYSTEMPATH']
> setattr(SCons.Tool.CScanner, 'path_function',
> SCons.Scanner.FindPathDirs('_CPPPATHS'))
>
>
> And this can be used like this :
>
> env.Append(CPPSYSTEMPATH = ["/usr/local/include/boost-1_55"])
>
>
> I have added this peace of code directly in my SConstruct file, and I
> do not know in which file I should add it in SCons. As far as I know
> "isystem" flag is only a GCC flag and I do not know a MSVC equivalent
> for instance.
>
> I hope my solution will help people that meet this requirement, and if
> I can help to introduce the code in SCons project, I would be pleased
> to participate.
>
> Best Regards,
>
> Paul Grégoire
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20141014/96fe2656/attachment.html>
More information about the Scons-users
mailing list