[Scons-users] Windows resource files and variant builds
Tom Tanner
trtanner at btinternet.com
Tue Mar 17 11:38:36 EDT 2015
The problem is that the .res file contains a path to a .dll, which when
the resource is compiled, causes rc to attempt to read the dll. And the
dll in question is part of the build of this project.
And with a variant dir, you're doing the build from above where the
files get stored, so ..\\..\\etc points to outer space.
In order to get the rc file to be compiled, you need to specify
something like
IDR_LOADER_DLL BINARY MOVEABLE PURE "<variant
dir>\\otherModule\\otherModule.dll"
which I have at eventually got round by doing
IDR_LOADER_DLL BINARY MOVEABLE PURE DLL_TO_USE
and setting RCFLAGS like this
other=env.File(os.path.join('..','..','otherModule','otherModule.dll'))
env.AppendUnique(RCFLAGS=[ '-DDLL_TO_USE="\\"%s\\""'%other.abspath ])
and it needs all those double quotes and backslashes! But it'd be nice
if I could get a 'path relative to where the SConstruct file is' somehow
as that .abspath works out as something depressingly long.
On 17/03/2015 15:22, Bill Deegan wrote:
> Assuming ../../otherModule is your variantdir, then there's no need to
> have the path.
> As long as you specify the .res file as a source to the linker, it
> should do the right thing.
>
> -Bill
>
> On Tue, Mar 17, 2015 at 6:43 AM, Tom Tanner <trtanner at btinternet.com
> <mailto:trtanner at btinternet.com>> wrote:
>
>
> I've just been putting an scons build into a windows QT project
> and I ran into an interesting thing on a windows
> resource file when using variant dirs
>
> The resource file contains this:
>
> #ifdef _DEBUG
> IDR_LOADER_DLL BINARY MOVEABLE PURE
> "..\\..\\otherModule\\debug\\otherModule.dll"
>
> #else // _DEBUG
>
> IDR_LOADER_DLL BINARY MOVEABLE PURE
> "..\\..\\otherModule\\release\\otherModule.dll"
>
> #endif // _DEBUG
>
> and I'm rather at a lose at what to put in there. Clearly I can
> get rid of the 'debug' and 'release' bits, but
> it seems like I want to put the <variantdir>\\ in there somehow.
> And I'm somewhere in an SConscript file which
> doesn't know what they are.
>
> The other thing I'm having a problem with is that presumably the
> generated file will depend on the dll. Now, there's
> a build for the dll, but if I put
>
> env.Depends('my.res','..\\..\\otherModule\\otherModule.dll')
>
> I get:
>
> Explicit dependency `source\otherModule\\otherModule.dll' not found
>
> But that module is built by another SConscript in the same build.
> But obviously it's not in 'source'
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org <mailto: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
More information about the Scons-users
mailing list