scons

How to augment scons' $*COMSTR

烂漫一生 提交于 2019-12-11 12:35:29
问题 I can define a custom build command output by defining $*COMSTR in my environment: env['CXXCOMSTR'] = compile_source_message However, this overrides the message shown for the build command. I want to augment the message instead, e.g. by prefixing it with the target. My goal is to have a message like this: % scons Compiling foo.o cc -o foo.o -c foo.c I tried the following: env['CXXCOMSTR'] = compile_source_message + '\n' + env['CXXCOMSTR'] However, this doesn't work because CXXCOMSTR is not in

Nested SCons Builder

瘦欲@ 提交于 2019-12-11 07:18:48
问题 I would like to do some post-processing of a SCons Builder output: env = Environment() bld = Builder(action = 'postproc $SOURCE $TARGET') env.Append(BUILDERS = {'PostProc': bld}) prog = env.Program('foo.c') env.PostProc('foo.pp',prog) This works as expected. However, I would prefer using a single Builder call, so I thought I could nest it like this: env = Environment() bld = Builder(action = 'postproc $SOURCE $TARGET') env.Append(BUILDERS = {'PostProc': bld}) def build_pp(env, target, source)

How to configure scons to link using rpath on mac?

元气小坏坏 提交于 2019-12-11 05:55:19
问题 It works on Ubuntu to link my task using RPATH, but on mac, it doesn't work env.Program(source = Glob("*.cpp") + Glob("../*.cpp"), LIBS = [ "l_util", "boost_system", "boost_timer", ], LIBPATH = libPath, RPATH = libPath, CPPPATH = includePath) On Ubuntu, using ldd , I can see shared libs are linked with absolute path. But using otool -L on mac gives me relative path to top dir of my Sconstruct file. Anyone setup RPATH correctly on mac using scons? 来源: https://stackoverflow.com/questions

How to build Apache WebSocket module?

岁酱吖の 提交于 2019-12-11 04:36:13
问题 I was trying for many hours to solve this. I have found Apache-WebSocket from Disconnect and decided to try this out. The description recommends Scons. However, to be able to use Scons, I need Python as well. I installed the newest 3.x+ Python, but when I installed Scons as well and tried to build the module, it told me that Python 3.x+ is not supported yet. Ok, I uninstalled both Scons and Python, then installed Python 2.7.7. After I have done that, I faced further difficulties, since Python

append value to environment variable on builder call

僤鯓⒐⒋嵵緔 提交于 2019-12-11 03:15:23
问题 The problem is as follows: I have an environment with some variables defined like this: env = Environment(CPPPATH=['#/include']) In some cases I need to invoke a builder with some extra values which should not be added permanently to the environment to not unnecessarily pollute it. One way is to append the extra value to the builder call by merging it with the environment's value. env.Object('test.c', CPPPATH=['#/some_other_include_path']+env['CPPPATH']) Is there a more elegant way to do it?

SCons dependencies between SConstruct-independent projects in different directories

怎甘沉沦 提交于 2019-12-11 03:12:17
问题 Right now I have a project structure similar to this one: project1/SConstruct (creates library1 and executable1) files project2/SConstruct (creates library2 and executable2) files project3/SConstruct (creates executable3 without libraries creates executable4 with library1 and library2) files I can build all projects with SCons without problems, but I'd like to add a dependency from projects 1 and 2 into project 3. When running scons in project 3, if projects 1 or 2 are not up-to-date, I'd

Using scons to compile c++ file with -std=c++11 flag

耗尽温柔 提交于 2019-12-11 02:52:27
问题 I am trying to compile a c++ file with -std=c=+11 option using scons. File : test.cc #include <unordered_map> int foo() { return 0; } File : SConstruct env = Environment() env.Append(CXXFLAGS = '-std=c++11') #print env['CXXFLAGS'] src_files = Split('test.cc') lib_name = 'test' Library(lib_name, src_files) I am getting the following error. It seems CXXFLAGS is not taking effect when g++ is invoked: g++ -o test.o -c test.cc In file included from /usr/include/c++/4.8.2/unordered_map:35:0, from

SCons: modify intermediate builder calls

99封情书 提交于 2019-12-11 00:36:23
问题 Is it possible to change the calls to intermediate builders, e.g. by passing a target prefix, to avoid environment conflicts? As an example, suppose you want to use a source file for two different libraries using different compiler macros like this: env.Library('libraryA', 'source.c', CCFLAGS=['-DCONFIG_X']) env.Library('libraryB', 'source.c', CCFLAGS=['-DCONFIG_Y']) SCons detects a conflict, because the Library-Builder invokes the Object-Builder to compile the source file first with

SCons does not clean all files

拥有回忆 提交于 2019-12-10 21:02:49
问题 I have a file system containing directories of "builds", each of which contains a file called "build-info.xml". However some of the builds happened before the build script generated "build-info.xml" so in that case I have a somewhat non-trivial SCons SConstruct that is used to generate a skeleton build-info.xml so that it can be used as a dependency for further rules. I.e.: for each directory: if build-info.xml already exists, do nothing. More importantly, do not remove it on a 'scons --clean

SCons can't pick the compiler (MinGW) [duplicate]

孤人 提交于 2019-12-10 18:05:57
问题 This question already has answers here : How to tell scons to use MinGW instead of MSVC (2 answers) Closed 4 years ago . I have a simple SConstruct file with the following code path = ['C:\\MinGW\\bin'] env = Environment(ENV = {'PATH' : path}) Program(target = 'myprogram', source = ['main.cpp']) running 'scons' on cmd gives the following error message: cl /Fomain.obj /c main.cpp /TP /nologo 'cl' is not recognized as an internal or external command, operable program or batch file. scons: ***