[Scons-users] scons and clang++

Florian Lindner mailinglists at xgm.de
Wed Jul 16 09:55:24 EDT 2014


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



More information about the Scons-users mailing list