[CMake] /DELAYLOAD flag doesnt stick when making a vc8 project

Philip Lowman philip at yhbt.com
Sat Sep 22 05:57:10 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ben Ratzlaff wrote:
> I've tried:
> SET (CMAKE_SHARED_LINKER_FLAGS
>     "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:dnssd.dll"
> )
> 
> and
> 
> SET_TARGET_PROPERTIES (${MY_PROJECT} PROPERTIES
>     LINK_FLAGS "/DELAYLOAD: dnssd.dll"
> )
> 
> and after I build the project in Visual Studio 2005, I am greeted with
> the dialog that says dnssd.dll is required.
> 
> This does not happen when building the project with nmake, the
> executable runs just fine.

I did a quick test and /DELAYLOAD is showing up properly in the linking
flags with the latest nightly CVS builds for me using the LINK_FLAGS
option to SET_TARGET_PROPERTIES.

I suspect that your problem may be an environmental issue.  Have you
made sure that the way you run the nmake generated EXE is the same way
you run the Visual Studio generated EXE?  Perhaps you're trying to debug
your application with VS and it's squashing your PATH and not finding
the DLL?  Perhaps you're running the nmake generated EXE in a command
prompt that somehow has a different PATH environment variable set for it?

Assuming those ideas don't solve your problem, there probably is a way
to look at the commands that nmake is running to compile and link your
code.  I'm not sure how to do this though.

Assuming you could get the commands being run by nmake you could compare
them to the Visual Studio Linker Properties on your project to ensure
they are identical.

- --
Philip Lowman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG9Ob2e0tOktX6RKkRAqbAAJ0eCnNneGyUT4qv74Xqhyjj/k4c3wCeOaVb
BRqIPkrDnvWBB3dVPDpvgfg=
=hFg9
-----END PGP SIGNATURE-----


More information about the CMake mailing list