scons

SCons libraries and sub-libraries

旧街凉风 提交于 2020-01-03 19:31:31
问题 I have a hierarchical build system based on SCons. I have a root SConstruct that calls into a SConscript that builds a shared library and then into a different SConscript that builds an executable that depends on the shared library. So here's my question: my understanding of shared libraries on linux is that when you want to do the final ld link for the executable that will be using the shared lib, the shared lib has to be included on the executable's ld command line as a source to reference

SCons custom builder - build with multiple files and output one file

痞子三分冷 提交于 2020-01-03 11:29:09
问题 If I have an executable that generates an output from multiple files at a time - generate_output -o a.out -f input1.txt input2.txt input3.txt Is there a way to write such a custom builder for this? What I have at the moment is - builder = Builder( action='generate_output -o $TARGET -f $SOURCE', suffix='.out', src_suffix='.txt') Then it only generates files in a sequence, which is not what I really wanted - generate_output -o input1.out -f input1.txt generate_output -o input2.out -f input2.txt

SCons custom builder - build with multiple files and output one file

倖福魔咒の 提交于 2020-01-03 11:29:07
问题 If I have an executable that generates an output from multiple files at a time - generate_output -o a.out -f input1.txt input2.txt input3.txt Is there a way to write such a custom builder for this? What I have at the moment is - builder = Builder( action='generate_output -o $TARGET -f $SOURCE', suffix='.out', src_suffix='.txt') Then it only generates files in a sequence, which is not what I really wanted - generate_output -o input1.out -f input1.txt generate_output -o input2.out -f input2.txt

How to build-in gprof support to a program built with SCons?

梦想与她 提交于 2020-01-02 02:53:07
问题 Greetings, Here is my SConstruct file: env = Environment() env.Append(CCFLAGS=['-g','-pg']) env.Program(target='program1', source= ['program1.c']) Also here is the output of the compilation: scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... gcc -o program1.o -c -g -pg program1.c gcc -o program1 program1.o scons: done building targets. As you can see I pass the "-pg" option to the build environment. After I build, I run the program to

Real Hierarchical Builds with SCons?

浪尽此生 提交于 2020-01-01 04:30:08
问题 So I've read the questions on here about hierarchical builds like: Creating a Hierarchical Build with SCons I want to do real hierarchical construction of two standalone repos that both use scons that I set up as sub-repos using mercurial. Below is the file layout that illustrates what I want to do. Desired Layout: project_root/ (new project that builds bar app using the libfoo built from source) libfoo_subrepo/ (standalone project repo from bitbucket) src/ SConscript libfoo.c libfoo.h test/

Why doesn't clang show color output under Scons?

最后都变了- 提交于 2019-12-31 09:22:31
问题 When building with Scons, I can configure it to use clang like so: env["CXX"] = "clang++" However, it doesn't seem to preserve the color information that clang outputs. How can I make scons preserve the color? 回答1: According to the clang documentation, color is enabled only when a color-capable terminal is detected . SCons doesn't automatically pass on all environment variables to the process that runs the compiler, you have pass them explicitly. And TERM is not passed on to clang. Add the

Why doesn't clang show color output under Scons?

百般思念 提交于 2019-12-31 09:21:26
问题 When building with Scons, I can configure it to use clang like so: env["CXX"] = "clang++" However, it doesn't seem to preserve the color information that clang outputs. How can I make scons preserve the color? 回答1: According to the clang documentation, color is enabled only when a color-capable terminal is detected . SCons doesn't automatically pass on all environment variables to the process that runs the compiler, you have pass them explicitly. And TERM is not passed on to clang. Add the

Using Python subprocess.call() to launch an ncurses process

老子叫甜甜 提交于 2019-12-31 04:11:16
问题 I'm trying to call ct-ng (http://crosstool-ng.org/) from a SCons SConstruct script, so basically from Python. using the following method: ret = subprocess.call(["/mnt/build/pw_build/crosstool-ng/bin/ct-ng menuconfig"], env=env_cross,shell=True) crosstool-ng uses ncurses to present the user with a menu: Unfortunately when trying to navigate the menus I get: Using cat to display the sequences when using the arrow keys I see: :/mnt/build$ cat > /dev/null ^[OA^[OD^[OB^[OC^[OA^[OB^[OD^[OC^[OA^[OB

Using Python subprocess.call() to launch an ncurses process

ぐ巨炮叔叔 提交于 2019-12-31 04:11:11
问题 I'm trying to call ct-ng (http://crosstool-ng.org/) from a SCons SConstruct script, so basically from Python. using the following method: ret = subprocess.call(["/mnt/build/pw_build/crosstool-ng/bin/ct-ng menuconfig"], env=env_cross,shell=True) crosstool-ng uses ncurses to present the user with a menu: Unfortunately when trying to navigate the menus I get: Using cat to display the sequences when using the arrow keys I see: :/mnt/build$ cat > /dev/null ^[OA^[OD^[OB^[OC^[OA^[OB^[OD^[OC^[OA^[OB

SCons- *** No SConstruct file found

不羁的心 提交于 2019-12-30 18:47:09
问题 Installed SCons using # cd scons-2.3.0 # python setup.py install After Installation, when i try to run scons , got the below error. scons: * No SConstruct file found. File "/usr/local/lib/scons-2.3.0/SCons/Script/Main.py", line 905, in _main How to overcome this ??? 回答1: There are 3 ways to specify the SConstruct file when using SCons, as follows: Execute scons from the root of the project, where there should be a SConstruct file. This is the most standard way. From a subdirectory of the