Note that there are some explanatory texts on larger screens.

plurals
  1. POSCons: Separate debug/release build dirs with a hierarchical build
    primarykey
    data
    text
    <p>I just started learning to use SCons, anticipating that it solves some of my issues with make. I'm creating a source hierarchy to understand the basics of SCons.</p> <p>Let's start with this folder structure:</p> <ul> <li>test/foo: contains main.cpp, main.h</li> <li>test/bar: contains its own main.cpp, main.h</li> <li>test/common: contains utils.cpp and utils.h used by both foo and bar</li> <li>test/external/moo: the source to some external library, containing 'configure' which produces 'Makefile' (not using SCons), so SCons needs to invoke 'make' after 'configure'; I suspect this part might be tricky when build dirs are used</li> <li>test/build/debug: build dir for debug</li> <li>test/build/release: build dir for release</li> </ul> <p>Here's what I'd like to do:</p> <ul> <li><p>Have two types of builds: debug/release where the only difference is that debug specifies -DDEBUG to g++</p></li> <li><p>Use build dirs so that no .o files are created in my source tree. Let's call these build dirs "build/debug" and "build/release"</p></li> <li><p>Be able to invoke ./configure and make on another project that does not use SCons, followed by linking libmoo.a it produces with my project</p></li> <li><p>Have the builds be perfectly parallel (scons -j9 for an 8-core?)</p></li> <li><p>Have some debug/release-independent way of specifying libraries to link. Something like:</p> <pre><code>env.Program(target='foo', source=['foo/main.cpp', '#build/(DEBUG_OR_RELEASE)/lib/libsomething.a']) </code></pre></li> </ul> <p>What would the very basic SConstruct/SConscript files to do the above look like? Even just pointers in the right directions would be great too!</p> <p>Thanks in advance :-)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload