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

Bill Deegan bill at baddogconsulting.com
Tue Apr 28 18:57:15 EDT 2015


Endre,

If all you are trying to do is ensure that the object dirs aren't in the
source dirs, then you can just use a VariantDir for each source dir.
No need to do anything more complicated than that.

http://scons.org/doc/production/HTML/scons-user.html#chap-separate

-Bill

On Tue, Apr 28, 2015 at 12:13 PM, Endre Bak <ebak32 at gmail.com> wrote:

> 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
>>
>>
>
> _______________________________________________
> 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/a71d2b58/attachment-0001.html>


More information about the Scons-users mailing list