Msbuild and ClCompile options
Msbuild and ClCompile options
我用msbuild
编译C++代码,并在ClCompile
项中指定cl
选项。像...
<ItemGroup>
<ClCompile Include="something.cpp">
<FloatingPointModel>Precise</FloatingPointModel>
<WarningLevel>Level2</WarningLevel>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)Microsoft.Cpp.default.props" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.props" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.Targets" />
以上只是一个例子。 现在我想打印用于cl
调用的所有选项。 问题是:我该怎么做? 我第一次尝试使用类似以下内容的内容:
<Target Name="WriteToFile" AfterTargets="ClCompile" >
<WriteLinesToFile File="$(OutDir)log.txt" Lines="@(ClCompile)" Overwrite="true" />
</Target>
可悲的是,这只记录文件名(something.cpp
),而不是选项。
请注意,我知道编译器选项由Tracker.exe
存储在CL.command.*.tlog
文件中,但首先,我不想依赖它,因为它可能会发生变化,其次,我很可能需要在以后进行一些转换。我也知道我可以访问单个选项(如%(ClCompile.FloatingPointModel)
),但我也不想单独处理每个选项。
有没有更好的方法可以做到这一点?
没有微不足道的解决方案可以做到这一点。你可以在这里找到一个起点这里还有一个例子
相关文章:
- ClCompile项目也是一项任务
- 如何将 Python 脚本通过管道传输到命令(boost::p rogram::options)
- CLCompile /MP parallel group?
- Msbuild and ClCompile options
- Regex options for std::regex
- Netbeans :在编译命令末尾添加"Compile Line - Additional Options" "-lboost_system"
- C++ Eigen: 'Options' : 不是'Eigen::MatrixBase<Derived>'的成员
- 在装有 GCC 4.8 的 Mac 上"error: too many #pragma options align=reset"
- boost 如何将类型列表实现为类的"options"?
- visual studio 2013 options
- ClCompile and Emscripten
- "cout formatting options to print out currency values." 这是什么意思,我该怎么做?
- Boost-program-options:无值选项的通知器
- 为什么 Boost 使用全局函数覆盖来实现自定义验证程序"Program Options"