[Scons-users] MSVC linker always relink with shared library?

Thomas Berg merlin66b at gmail.com
Tue Aug 14 10:23:04 EDT 2018


SCons does not parse your code and check whether you are exporting any
symbols. But there is a flag you can set to tell scons not to expect a .lib
file to be generated:

env['no_import_lib'] = 1

I think this stops the rebuilding in your case.

Hope this helps,
Thomas


On Tue, Aug 14, 2018 at 3:55 PM Daniel Moody <dmoody256 at gmail.com> wrote:

> Thanks, scons told me it wasn't building the import lib, this was because
> I wasn't exporting any symbols with my example. Should scons know about
> this case?
>
> On Tue, Aug 14, 2018, 6:11 AM Gary Oberbrunner <garyo at oberbrunner.com>
> wrote:
>
>> Hi Daniel; can you try with 'scons --debug=explain' ? That might show why
>> it thinks it needs to be rebuilt.
>>
>> On Tue, Aug 14, 2018 at 12:59 AM Daniel Moody <dmoody256 at gmail.com>
>> wrote:
>>
>>> Anyone else seeing this with latest release (3.0.1)? It doesn't re-link
>>> with Program when building an executable.
>>>
>>> Here is my SConstruct:
>>>
>>> env = Environment()
>>> env.SharedLibrary('test', 'test1.c')
>>>
>>> Here is test1.c:
>>>
>>> int foo(){ return 0; }
>>>
>>> When I run this the first time this is my output:
>>>
>>> C:\Users\Daniel\workspace>scons -f SConstruct.py
>>> scons: Reading SConscript files ...
>>> scons: done reading SConscript files.
>>> scons: Building targets ...
>>> cl /Fotest1.obj /c test1.c /nologo
>>> test1.c
>>> link /nologo /dll /out:test.dll /implib:test.lib test1.obj
>>> scons: done building targets.
>>>
>>> If I run the same command again without changing anything, I get the
>>> link again:
>>>
>>> C:\Users\Daniel\workspace>scons -f SConstruct.py
>>> scons: Reading SConscript files ...
>>> scons: done reading SConscript files.
>>> scons: Building targets ...
>>> link /nologo /dll /out:test.dll /implib:test.lib test1.obj
>>> scons: done building targets.
>>>
>>> Subsequent runs of the command produce the link again.
>>>
>>> I have Visual Studio 2015 installed.
>>>
>>> Scons and Python:
>>> C:\Users\Daniel\workspace>scons -v
>>> SCons by Steven Knight et al.:
>>>         script: v3.0.1.74b2c53bc42290e911b334a6b44f187da698a668,
>>> 2017/11/14 13:16:53, by bdbaddog on hpmicrodog
>>>         engine: v3.0.1.74b2c53bc42290e911b334a6b44f187da698a668,
>>> 2017/11/14 13:16:53, by bdbaddog on hpmicrodog
>>>         engine path:
>>> ['c:\\python36\\lib\\site-packages\\scons-3.0.1\\SCons']
>>> Copyright (c) 2001 - 2017 The SCons Foundation
>>>
>>> C:\Users\Daniel\workspace>python --version
>>> Python 3.6.5
>>>
>>>
>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>
>>
>> --
>> Gary
>> _______________________________________________
>> 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/20180814/9c347bf6/attachment.html>


More information about the Scons-users mailing list