Scons directory for object files




















What makes SCons better? Configuration files are Python scripts--use the power of a real programming language to solve build problems.

Dependency analysis is easily extensible through user-defined dependency Scanners for other languages or file types. Fointard Fointard 21 6 6 bronze badges. Move your current sources together with the SConstruct you have into a new subfolder "src".

Then apply the recipes from the SCons User Guide , especially chap. That should make it work automatically Problems are : 1 - the source files are part of a git submodule which does not belong to me. Meaning I can't upstream changes to it, therefore can't "move my current sources into a new subfolder" If you plan to have your object files in a separate folder, using variant directories is the canonical way.

You can probably do it with one SConstruct, but it's not easy to setup and maintain You can also create a second SConscript on the top-level next to your SConstruct and call that in the SConcript method.

Related: stackoverflow. Show 5 more comments. Active Oldest Votes. I can execute it just fine from the command line. How do I install files? The Install method doesn't do anything. In general, how do I build anything outside my current directory? Where do I get SCons? What's the difference between the scons, scons-local, and scons-src packages? What version of Python do I need? Do I need to know how to program in Python to use SCons?

Are there any SCons mailing lists or newsgroups? Are they archived anywhere? Is SCons released under an Open Source license? Can I help with SCons development? How do I get SCons to find my include files? Why is my directory only updated the first time? I'm already using ldconfig, pkg-config, gtk-config, etc. Do I have to rewrite their logic to use SCons? How do I fix this? How do I prevent commands from being executed in parallel? Compatibility with make Is SCons compatible with make? Does SCons support building in parallel, like make's -j option?

Is SCons the same as Cons? So what can SCons do that Cons can't? Should I use Cons or SCons for my project? We make SCons available in three distinct packages, for different purposes. No, you can use SCons very successfully even if you don't know how to program in Python.

Here is the explanation from the SCons man page: SCons does not automatically propagate the external environment used to execute ' scons ' to the commands used to build target files. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time scons is invoked.

This also means that if the compiler or other commands that you want to use to build your target files are not in standard system locations, SCons will not find them unless you explicitly set the PATH to include those locations.

Program 'foo' , 'foo. Default env. Alias "install" , env. ParseConfig 'pkg-config --cflags --libs libxml'. In older versions of scons this function was named BuildDir.

You may also want to read up on avoiding duplicating the source directory described both in the user guide and on the wiki. I was using a two-file method like richq's answer, but although the final build products libs, programs were going into the right variant directory, the object files were still going to the source directory.

The solution turned out to be to glob the source files by relative path instead of absolute. I have no idea why. My second scons file originally looked like this.



0コメント

  • 1000 / 1000