MS Build: Access compiler settings in a subsequent task

前端 未结 1 1405
一向
一向 2021-01-20 22:01

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 use

相关标签:
1条回答
  • 2021-01-20 22:14

    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>
    
    0 讨论(0)
提交回复
热议问题