Fail to set /DELAY and /DELAYLOAD at the same time in vs2017
My project has two kinds of configurations,Debug and Release,in vs2017.I need to set /DELAY and /DELAYLOAD in both of them.So I wrote like this:
set_target_properties(PROJECT PROPERTIES LINK_FLAGS "/DELAY:UNLOAD")`
set_target_properties(PROJECT PROPERTIES LINK_FLAGS "/DELAYLOAD:test.dll")
But I failed.Only the /DELAYLOAD was set successfully in two configurations.Then I changed the order of the two sentences.Only the /DELAY was set.
Finally,I found that if I wrote like this,it would be OK.
set_target_properties(PROJECT PROPERTIES LINK_FLAGS "/DELAY:UNLOAD")
set_target_properties(PROJECT PROPERTIES LINK_FLAGS_DEBUG "/DELAYLOAD:test.dll")
set_target_properties(PROJECT PROPERTIES LINK_FLAGS_RELEASE "/DELAYLOAD:test.dll")
I think my first way should be right.
The version of CMAKE is 3.16.5
Edited by Craig Scott