scons

How to point scons to a different compiler installed in my home directory?

一笑奈何 提交于 2019-12-23 20:12:44
问题 I have tried editing SConstruct to point to a different gcc compiler but it always seems to use the one defined in /usr/bin/gcc and /usr/bin/g++. env = DefaultEnvironment() env['CC'] = '/home/aaron/devel/bin/gcc' env['CXX'] = '/home/aaron/devel/bin/g++' What am I doing wrong? Also, is there a way to specify a different compiler on the command line using something like: scons cxx=/home/aaron/devel/bin/g++ I've gone crazy trying to make this work. Thanks! 回答1: There is a suggestion in "Why

Use a Glob() in VariantDir() einvironment to find files recursively in Python?

北城以北 提交于 2019-12-23 19:03:02
问题 How can one make recursive Glob() in a VariantDir() environment in Python? The answer from the question <Use a Glob() to find files recursively in Python?> will not work, because you need use Glob() to get a list of files that is aware of VariantDir() environment. So you need something like: import fnmatch import os matches = [] for root, dirnames, filenames in os.walk('src'): for filename in fnmatch.filter(filenames, '*.c'): matches.append(os.path.join(root, filename)) matches = Glob(matches

Build-time determination of SCons targets

最后都变了- 提交于 2019-12-23 02:40:24
问题 I have some targets that need to be built in order to determine what some of my other targets are. How do I tell SCons? An example: A script, generate is run on some configuration files. This script generates include path and build flags based on information in the configuration files. In order to build a SCons Object , I need to read the generated files. I was just running Execute() on generate but it's now got lots of files to generate and it takes a good amount of time, so I only want to

Coloring compiler diagnostics with SCons

依然范特西╮ 提交于 2019-12-22 18:27:26
问题 I am currently using the colorama package to color messages generated by my build scripts. I have also used scolorizer, which replaces the build commands with custom, colored messages using strfunction() in SCons. This sure makes build output less verbose and warnings easier to spot. However, I often prefer to see the full command lines when building. Is there a mechanism in SCons to capture compiler output, giving the opportunity to inject some terminal colors before printing it out? 回答1:

Coloring compiler diagnostics with SCons

喜欢而已 提交于 2019-12-22 18:27:15
问题 I am currently using the colorama package to color messages generated by my build scripts. I have also used scolorizer, which replaces the build commands with custom, colored messages using strfunction() in SCons. This sure makes build output less verbose and warnings easier to spot. However, I often prefer to see the full command lines when building. Is there a mechanism in SCons to capture compiler output, giving the opportunity to inject some terminal colors before printing it out? 回答1:

Scons: Generating version file only if target has changed

你说的曾经没有我的故事 提交于 2019-12-22 09:06:32
问题 I have a requirement to generate version.cc file from SCons Script. This file should be generated only if any of the source file for a target has changed. Suppose the SCons script has the following statements #python function which generates version.cc in the same folder where libtest.a is generated. This will always generate a differnt version.cc because the version string contained inside that will have timestamp GenerateVersionCode() #target which uses version.cc libtest = env.Library(

SCons: Get abspath of original file (as though I hadn't set variant_dir)

旧巷老猫 提交于 2019-12-22 04:18:20
问题 I can use File('foo.bar').abspath to get the location of a file, but if I've got variant_dir set then the returned path will be in variant_dir rather than it's original location. If I have duplicate=0 set, then the file returned won't actually exist. Obviously SCons knows where the original file is, as it's passed as an argument when the file's actually built (eg gcc -c -o variant/foo.o orig/foo.c ). Is there some sort of File('foo.bar').origpath that I can use? If it came to it I could use

What is the file .sconsign.dblite for?

江枫思渺然 提交于 2019-12-22 01:25:11
问题 What would happen if I delete it? Should I put it under version control? 回答1: The .sconsign.dblite file is a temporary database used by SCons to keep file signatures to speed up future builds. If you delete it, SCons will recreate it (and your next build might take slightly longer because of that). It should not be put under version control. 来源: https://stackoverflow.com/questions/12867783/what-is-the-file-sconsign-dblite-for

Scons Hierarchical Builds with Repository directory

筅森魡賤 提交于 2019-12-22 01:09:44
问题 I have an SCons project set up as follows: proj/ SConstruct src/ c/ h/ app1/SConscript app2/SConscript ... All source/header files for each application are located in src/c and src/h. At first step I created a SConstruct in app1 which use the Repository function. ... src=Split("main.c first.c second.c") env = Environment(CC='g++', CCFLAGS=['-O0', '-ggdb'], CPPPATH=['.']) env.Program('appone', src) Repository("../src/c", "../src/h") All works fine. scons found all necessary source/header files

How to tell scons to use the C++11 standard

断了今生、忘了曾经 提交于 2019-12-21 10:57:10
问题 I don't manage to find how to tell scons to accept c++11 standard: the SConstruct file: env=Environment(CPPPATH='/usr/include/boost/', CPPDEFINES=[], LIBS=[], SCONS_CXX_STANDARD="c++11" ) env.Program('Hello', Glob('src/*.cpp')) the cpp file: #include <iostream> class A{}; int main() { std::cout << "hello world!" << std::endl; auto test = new A; // testing auto C++11 keyword if( test == nullptr ){std::cout << "hey hey" << std::endl;} // testing nullptr keyword else{std::cout << " the pointer