MSBuild Managed vs Unmanaged property

前端 未结 2 1444
暖寄归人
暖寄归人 2021-01-18 08:11

Is there a way in MSBuild logic to determine if I am running managed vs unmanaged code? Not C++ vs C#, but just managed vs unmanaged? I\'d like to set some properties (usu

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-18 08:36

    In C++, each item in ClCompile (list of source files) has a CompileAsManaged metadata value. Setting properties is difficult since it can vary for each source file, but is more straightforward if you only expect (and support) keying off the whole-project setting. Toggle that in the IDE and see what changes in the vcxproj file. It has a few different values to choose from.

提交回复
热议问题