scons

How to execute scons in a python3 environment?

别等时光非礼了梦想. 提交于 2019-12-07 16:24:49
问题 I need to import python3 scripts within a scons script. (I use scons v3.0.1.7) Is there a way to execute scons with python 3 ? The offical scons site says This will be the first release to support Python versions earlier than 2.7 as well as 3.5+ Something like scons -python /usr/bin/python3 would be good to select the python interpreter. I did not find either how to build a scons version for python3. 回答1: In the latest versions, SCons supports both Python2 and Python3. There is no need to

Linux下hiredis、jsoncpp的安装

左心房为你撑大大i 提交于 2019-12-07 09:06:04
以下库将安装到/usr/local/lib,头到/usr/local/include hiredis的安装 下载https://github.com/redis/hiredis 解压 cd hiredis make make install linux下正确安装jsoncpp scons下载地址:wget http://prdownloads.sourceforge.NET/scons/scons-2.2.0.tar.gz Jsoncpp 下载地址 http://sourceforge.net/projects/jsoncpp/files/latest/download?_test=goal #tar -zxvf scons-2.1.0.tar.gz #cd scons-2.1.0 #python setup.py install #cd .. #tar -zxvf jsoncpp-src-0.5.0.tar.gz #cd jsoncpp-src-0.5.0 #scons platform=linux-gcc #cp libs/linux-gcc-7/* /usr/local/lib #cp -r /home/lgl/下载/jsoncpp/jsoncpp-src-0.5.0/include/json /usr/local/include/json 来源: oschina 链接:

How to debug SCons scripts using eclipse and pydev?

我的未来我决定 提交于 2019-12-07 08:32:21
问题 I'm a newbie to SCons and also using pydev. Can someone help me with instructions on how to debug scons scripts using Eclipse and pydev? Is it even possible considering the fact that SCons is a seperate app and not an extension to python? 回答1: I'm not an Eclipse expert, but since you didn't get any other answer... If you make the SCons source a part of the Eclipse project, and run the whole command from within Eclipse it should work like any Eclipse debugging. SCons is written in Python,

How can I set options in SConstruct for C compiler depending on compiler type?

百般思念 提交于 2019-12-07 06:53:43
问题 I need to set additional options for C compiler, e.g. add flag to turn all warnings ON, depending on the type of the compiler. E.g. for MSVC I should use env.Append(CPPFLAGS = "/Wall") but for mingw (gcc) I need to use: env.Append(CCFLAGS = "-Wall") How can I do this in scons way? 回答1: You could just check for the name of the compiler: cc = env['CC'] if cc == 'cl': env.Append(CPPFLAGS = '/Wall') elif cc == 'gcc': env.Append(CCFLAGS = '-Wall') 来源: https://stackoverflow.com/questions/1961164

How can I get SCons to replace text in installed text files

旧街凉风 提交于 2019-12-07 06:46:15
问题 I'd like to be able to replace a template variable ('$(SOFTWARE_VERSION)') while installing some python scripts from scons. Does scons already have such functionality? If not, what's the best way to hook into the scons install process so I can do this during install? 回答1: You could use the Substfile method. This takes a input file and produces an output file substituting marked variables. So if you have script.py.in : #!/usr/bin/python print "$SOFTWARE_VERSION" Then you can use the following

Determine list of source files (*.[ch]) for a complex build with scons

青春壹個敷衍的年華 提交于 2019-12-07 02:00:59
问题 Suppose you have a complex source tree for a C project, lots of directories with lots of files. The scons build supports multiple targets (i386, sparc, powerpc) and multiple variants (debug, release). There's an sconstruct at the root (referencing various sconscripts ) that does the right thing for all of these, when called with arguments specifying target and variant, e.g. scons target=i386 variant=release . Is there an easy way to determine which source files (*.c and *.h) each of these

What do you do to make compiler lines shorter?

时间秒杀一切 提交于 2019-12-07 01:57:06
问题 Often when I'm working on a project with others, the amount of library paths and include paths that get sourced by the compiler in the Makefile get more numerous as time goes by. Also the paths can get very long as well. Here's an example: g++ -c -pipe -O2 -Wall -W -DQT_BOOTSTRAPPED -DQT_MOC -DQT_NO_CODECS -DQT_LITE_UNICODE -DQT_NO_LIBRARY -DQT_NO_STL -DQT_NO_COMPRESS -DQT_NO_DATASTREAM -DQT_NO_TEXTSTREAM -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_THREAD -DQT_NO_REGEXP -DQT_NO_QOBJECT

Forcing scons to use older compiler?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 21:58:16
问题 I have a C++ project which is using boost. The whole project is built using scons + Visual Studio 2008. We've installed Visual Studio 2010 and it turned out scons was attempting to use the later compiler instead of the old one - and failed to build the project as boost and visual studio 2010 don't like each other very much - yet. We'd like to suppress this and force scons to use the 2008 version. Is this possible? How do we do this? 回答1: You can modify the scons Environment() by just choosing

Coloring compiler diagnostics with SCons

≯℡__Kan透↙ 提交于 2019-12-06 13:34:53
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? You can do this by setting CC and CXX in the environment to a suitable wrapper around your compiler, for

Do we need sconscript file in every source directory

╄→гoц情女王★ 提交于 2019-12-06 08:59:31
问题 I am using scons to compile my project. In my project source files are in different directories. Do we need sconscript file in every directory to compile those project source files? I tried to compile all directories with the single sconscript file. But all object files are adding to my source directory only. I am using this function: env.Library('libs',files_list) If files_list contains the only file names then Obj files are generating @ variant directory. If files_list contains the file