Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create an alias for a build target with a relative path in Scons?
    primarykey
    data
    text
    <h2>Background</h2> <p>I'm trying out Scons by setting up a basic C++ sample project that has two sub-projects:</p> <ul> <li>Prj1 is an EXE that depends on Prj2</li> <li>Prj2 is a DLL that exports some functions</li> </ul> <p>You can see the directory structure and the contents of my SConstruct and SConscript files <a href="https://stackoverflow.com/questions/279860/how-do-i-get-projects-to-place-their-build-output-into-the-same-directory-with">here</a></p> <h2>Problem</h2> <p>The problem I'm running into is that in order to build these targets from the command line I have to specify both the relative path to their build directory and their platform specific file extensions.</p> <p>For example, to build Prj1 I have to do:</p> <pre><code> build> scons ../bin/project1.exe </code></pre> <p>Likewise, to build Prj2 I have to do:</p> <pre><code> build> scons ../bin/project2.dll </code></pre> <h2>Question</h2> <p>How can I make SCons build these projects without specifying the relative path and platform specific file extension?</p> <p><strong>Desired:</strong></p> <pre><code> build> scons project1 build> scons project2 </code></pre> <h2>Potential Solutions</h2> <ul> <li>Use Alias - I'm pretty sure this <strong>is</strong> what I want but I'm messing something up apparently. I've tried the following without success:</li> </ul> <pre><code> prj1_env.Alias( 'project1', PROG) prj1_env.Alias( 'project1', os.path.join( BIN_DIR, PROG) ) </code></pre> <h2>References</h2> <ul> <li><a href="https://stackoverflow.com/questions/279860/how-do-i-get-projects-to-place-their-build-output-into-the-same-directory-with">How do I get projects to place their build output into the same directory with Scons?</a></li> </ul>
    singulars
    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.
 

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