[Scons-users] placing object files to one common directory

Endre Bak ebak32 at gmail.com
Tue Apr 28 12:13:57 EDT 2015


Other solution I've found that it is possible to explicitly tell the
location for each object files.


import SCons

GTEST_DIR = '../GTestGMock/gtest-1.7.0'

env = Environment()
env.Append(CXXFLAGS = '-g -Wall -Wextra -pthread -isystem
{}/include'.format(GTEST_DIR))

gtestAllObj = Object(
    target='objs/gtest-all.o', source=GTEST_DIR+'/src/gtest-all.cc',
    CPPPATH=[GTEST_DIR, GTEST_DIR + '/include']
)

env.StaticLibrary('objs/gtest', [gtestAllObj])

On Tue, Apr 28, 2015 at 1:22 PM, Michael Lahnert <
michael.lahnert at ipvs.uni-stuttgart.de> wrote:

> Hi,
>
> On Tue, 2015-04-28 at 11:31 +0200, Endre Bak wrote:
> > " There isn't a good reason to copy objects around IMHO." Placing .o
> files
> > into the source directory is an ugly thing. And I don't want to copy
> objects
> > around, I want the compiler to place the .o files directly into the
> object
> > directory.
> >
> > The VariantDir() function doesn't seem to be working at all:
>
> This minimal example actually _is_ working:
> env = Environment()
> name = 'helloWorld'
> srcs = 'helloworld.c
> varDir = 'build/'
> srcs = varDir + srcs
>
> env.VariantDir("build", ".", duplicate=0)
> env.Program(name, srcs)
>
> If you want to Glob your sources together inside a separate source
> directory,
> you may follow the attached slightly more sophisticated example.
>
> Best regards,
> Michael
>
> --
> Dipl.-Inf. Michael Lahnert
> Simulation großer Systeme
> Institut für Parallele und Verteilte Systeme, Universität Stuttgart
> Universitätsstraße 38
> 70569 Stuttgart | Germany
>
> Tel: +49 (0)711 685 88560
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150428/85fa6c52/attachment.html>


More information about the Scons-users mailing list