scons

SCons problem - dont understand Variables class

ぃ、小莉子 提交于 2019-12-10 17:41:33
问题 I'm working on an SConstruct build file for a project and I'm trying to update from Options to Variables, since Options is being deprecated. I don't understand how to use Variables though. I have 0 python experience which is probably contributing to this. For example, I have this: opts = Variables() opts.Add('fcgi',0) print opts['fcgi'] But I get an error: AttributeError: Variables instance has no attribute '__getitem__': Not sure how this is supposed to work 回答1: Typically you would store

SCons configuration file and default values

不羁岁月 提交于 2019-12-10 14:59:35
问题 I have a project which I build using SCons (and MinGW/gcc depending on the platform). This project depends on several other libraries (lets call them libfoo and libbar ) which can be installed on different places for different users. Currently, my SConstruct file embeds hard-coded path to those libraries (say, something like: C:\libfoo ). Now, I'd like to add a configuration option to my SConstruct file so that a user who installed libfoo at another location (say C:\custom_path\libfoo ) can

Why does an std::any_cast of a passed std::any inside a dlopen'd function raise an error

别等时光非礼了梦想. 提交于 2019-12-10 09:59:47
问题 I am toying around with c++17 and plugins, and I have run into an error that I cannot get around. In the following MWE I can call a local function that takes a std::any , and everything works as expected when I try to read the contents. When I load this exact same function through a plugin (dlopen), it correctly sees the type on the any, but it cannot std::any_cast the contents. Any help would be greatly appreciated in figuring out what is causing this error. Here is my environment, MWE, and

scons : src and include dirs

流过昼夜 提交于 2019-12-09 13:07:37
问题 can someone give a scons config file which allows the following structure toplevel/ /src - .cc files /include .h files at top level I want the o and final exe. 回答1: Here is one example of Sconscript file env=Environment(CPPPATH='/usr/include/glib-2.0/:/usr/lib/glib-2.0/include:inc', CPPDEFINES=[], LIBS=['glib-2.0']) env.Program('runme', Glob('src/*.c')) (The environment line is not really necessary for the example, but I have it to include the non standard glib header path and left it there

Is it possible to automatically generate Xcode projects?

这一生的挚爱 提交于 2019-12-09 06:35:20
问题 Simple question. Are there any tools for generating Xcode projects from the command line? We use SCons to build our cross-platform application, but that doesn't support intrinsic Xcode project generation. We'd like to avoid creating the project manually, since this would involve maintaining multiple file lists. 回答1: I think that your question should be "Is there a way to generate an XCode project from a SCons one?". I suppose, by your asking and by reading the others, that the answer is 'no'.

Changing default C compiler in Linux, using SCons

不打扰是莪最后的温柔 提交于 2019-12-09 02:24:54
问题 On my Linux platform, I have several versions of gcc . Under usr/bin I have: gcc34 gcc44 gcc Here are some outputs: $ gcc --version gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48) $ gcc44 --version gcc44 (GCC) 4.4.0 20090514 (Red Hat 4.4.0-6) I need to use the 4.4 version of gcc however the default seems to the 4.1 one. I there a way to replace /usr/bin/gcc and make gcc44 the default compiler not using a symlink to /usr/bin/gcc44 ? The reason why I can't use a symlink is because my code will have

Creating a Hierarchical Build with SCons

会有一股神秘感。 提交于 2019-12-08 21:04:01
问题 I have a library project that contains some samples in a subfolder. The library itself has a SConstruct file and each sample has its own folder and its own SConstruct file. I'd like to add a target to the main (root) SConstruct file which would allow me to compile the library as usual, and all the samples, at once. Is there an existing mechanism/builder for this ? P.S: I don't want to have only one big SConstruct file because I want the samples folders to remain independant. 回答1: http://www

SCons to generate variable number of targets

ε祈祈猫儿з 提交于 2019-12-08 18:56:11
问题 I am trying to get SCons to generate multiple targets (number unknown directly in SConscript ). I have directory like: headers/ Header1.h Header2.h Header3.h Header4.h meta/ headers_list.txt Now I want SConscript to read headers_list.txt , basing on its contents pick files from headers/ directory (i.e. it might contain only Header1 and Header3 ), for each of those I want to generate source using some function. I have been trying to use env.Command to do that, but the issue is that it requires

Does scons know in which directory a SConscript file resides?

我的梦境 提交于 2019-12-08 16:27:35
问题 We are evaluating scons as a build system, and I am having a problem accomodating our old system. In some of our source code subdirectories, we have a "sources.lib" file that lists the names of the C++ files that need to be compiled to assemble that directory's target library. But, there are additional C++ files in the same directory, so I can't just use Glob() to find the appropriate ones. How do I find out which directory a SConscript file resides in? os.getcwd() always returns the build

Overriding SCons Cache Copy Function

元气小坏坏 提交于 2019-12-08 05:26:43
问题 I'm trying to figure out how to override the behaviour when SCons copies artifacts from the cache directory (given by CacheDir) to used hard-links. My current try def link_or_copy_file(class_instance, src, dst): # do hardlinking instead... SCons.Defaults.DefaultEnvironment()._copy_from_cache = link_or_copy_file SCons.Defaults.DefaultEnvironment()._copy2_from_cache = link_or_copy_file env = Environment() env._copy_from_cache = link_or_copy_file env._copy2_from_cache = link_or_copy_file has no