I'm writing my own MS build scripts which I import in the project file (*.vcxproj)
I would like to execute a task conditionally depending on the C runtime being used dynamically. I tried the following:
Condition = " '$(RuntimeLibrary)' == 'MultiThreadedDLL' "
But $(RunitmeLibrary) is not a Property but an argument to ClCompile.
Is there any other way to write a condition that checks whether the runtime is liked dynamically or statically?
Regards
The value you are looking for is metadata of the ClCompile item group. Use this:
Condition=" '%(ClCompile.RuntimeLibrary)' == 'MultiThreadedDll' "
I added this to the bottom of a vcxproj to see what the current setting was:
<Target Name="BeforeClCompile">
<Message Text="BeforeCompile: RuntimeLibrary=[%(ClCompile.RuntimeLibrary)]" Importance="high" />
</Target>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With