[Scons-users] Pass multiple build flags on the command line

William Blevins wblevins001 at gmail.com
Sat Aug 9 12:13:17 EDT 2014


You really should use *env.Append( [ '-g', '-O2'] )* instead.  You may want
to reconsider who your commandline arguments are being handled.

-William


On Sat, Aug 9, 2014 at 10:00 AM, Bertrand Marc <beberking at gmail.com> wrote:

> Dear Scons users,
>
> I am trying to build pingus with custom build flags. I'd like to pass
> two flags to g++ (-g -O2), so I launch the following:
> scons CXXFLAGS='-g -O2'
>
> Unfortunately it fails because the Sconstruct file appends
> ["-std=c++0x"] after CXXFLAGS and env.Append doesn't mix well lists and
> strings. I get the following error:
> g++ -o .sconf_temp/conftest_1.o -c "-g O2" -std=c++0x
> -isystem/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
> .sconf_temp/conftest_1.cpp
> cc1plus: error: unrecognised debug output level " O2"
> scons: Configure: failed
>
> You can see the issue: my build flags are between "".
>
> Of course I can change the Sconstruct file to make CXXFLAGS a string
> instead of a list, but is it the right solution ? Are there any downside
> to using strings instead of lists for buildflags ? Is there a way to
> pass a list of flags to the command line ?
>
> You'll find a minimal Sconstruct file based on the pingus' one. You can
> test it with the -c target easily.
>
> Thanks for your answer,
> Bertrand
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140809/b926828d/attachment.html>


More information about the Scons-users mailing list