[Scons-users] scons and clang++

Florian Lindner mailinglists at xgm.de
Wed Jul 16 10:59:57 EDT 2014


Gary Oberbrunner wrote:

> Could be something in your os.environ that's making clang++ work outside
> of SCons; SCons doesn't propagate the shell environment by default.
> Does it work if you do
>   env['ENV'] = os.environ()
> ?  If so, then you can pare that down to whatever variable is actually
> making it work.

I have put an

env['ENV'] = os.environ

at the top of my script, but changed nothing. It works with g++ but scons 
compiler=clang++ fails when searching for the libs, e.g. boost.

Thanks!
Florian

> 
> 
> On Wed, Jul 16, 2014 at 9:55 AM, Florian Lindner <mailinglists at xgm.de>
> wrote:
> 
>> Hello,
>>
>> I have a nicely working build script for g++. I want to modify it to be
>> able
>> to also compile using clang++.
>>
>> My build script: http://pastebin.com/BXCzgEvy
>>
>> There is only one place where I differentiate between g++ and clang:
>>
>> [...]
>> elif env["compiler"] == 'g++':
>>     pass
>> elif env["compiler"] == "clang++":
>>     env.Append(CCFLAGS = ["-stdlib=libc++"])
>>
>> While just "scons" with g++ as the default works, I get errors when using
>> clang. I always to an rm -rf .scon* and scons -c before each run.
>>
>> % scons compiler=clang++
>> scons: Reading SConscript files ...
>>
>> [...]
>>
>> Configuring build variables ...
>> Checking for C++ header file boost/array.hpp... no
>> ERROR: Header 'boost/array.hpp' (needed for Boost) not found or does not
>> compile!
>>
>>
>> Curious thing is that if I just put env["CXX"] = "clang++ -stdlib=libc++"
>> somewhere it works (the compilation failed with a clang error about not
>> finding <iostream> but scons seems to find all libraries.
>>
>> Thanks!
>> Florian
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> http://four.pairlist.net/mailman/listinfo/scons-users
>>
> 
> 
> 




More information about the Scons-users mailing list