[Scons-users] Changes in linker options don't rebuild SharedLibrary

Gary Oberbrunner garyo at oberbrunner.com
Tue Dec 17 08:51:00 EST 2013

Yes, this is a known issue in 2.3.0. It is fixed in the default branch in

On Mon, Dec 16, 2013 at 4:50 PM, Jason Swager <jswager at alohaoi.com> wrote:

> Hello,

> I've encountered what seems to be a rather serious problem in SCONS

> linking. I'm hoping that I'm just doing something stupid or misconfigured

> something, but something seems wrong. What I'm finding is that changing

> the linking options won't cause a rebuild of a shared library if it has

> already been built. Here are the details of the my situation...


> SCons 2.3. Visual Studio 2010. Windows 7 64bit machine.


> The DLL I'm compiling is REAL simple (SomeDLL.cpp):


> int hello()

> {

> return 0;

> }


> The SConstruct is also very simple:


> env=Environment(tools=['default'], MSVC_VERSION='10.0', TARGET_ARCH =

> 'x86', no_import_lib='1')

> env.AppendUnique(SHLINKFLAGS=['/FORCE']) #

> env.SharedLibrary(target='SomeDLL.dll', source=['SomeDLL.cpp'])


> Running this once, the DLL gets built. Run it a second time, nothing gets

> built because nothing has changed. If I comment out the second line (the

> SHLINKFLAGS modification), then run "scons" again, nothing gets rebuilt.

> Adding/removing that line should have caused a relink.


> I also tried changing LINKFLAGS and even LIBS, but modifications to those

> construction variables didn't cause a relink.


> Just for reference, changes to compilation flags CXXFLAGS, CPPPATH,

> CCFLAGS would cause a rebuild of the CPP file, resulting in a relink of the

> DLL. But changes to the linker options seem to be ignored.


> Am I doing something wrong?

> Thanks,

> Jason Swager


> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131217/61ee32c5/attachment-0001.html

More information about the Scons-users mailing list