7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

msbuildコマンドでのビルド時、プリプロセッサマクロの定義を追加する方法

Last updated at Posted at 2014-05-14

ADDITIONAL というマクロを追加する例。以下のようなファイルを用意して、

override.props
<?xml version="1.0" encoding="utf-8"?> 
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <ItemDefinitionGroup>
    <ClCompile>
      <PreprocessorDefinitions>%(PreprocessorDefinitions);ADDITIONAL</PreprocessorDefinitions>
    </ClCompile>
  </ItemDefinitionGroup>

</Project>

msbuild実行時にForceImportBeforeCppTargetsプロパティを設定する。
msbuild demo.vcxproj /p:ForceImportBeforeCppTargets=override.props

via Stackoverflow: How to set PreProcessorDefinitions as a task propery for the msbuild task - Stack Overflow

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?