ユーザ用ツール

サイト用ツール


opengl:visual_studio

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
opengl:visual_studio [2015/07/05 23:12] – [動作の確認方法] ogaopengl:visual_studio [2021/12/18 17:58] (現在) – [動作の確認方法] oga
行 561: 行 561:
  
  
 +===== 実際の使用例 =====
  
 +build_def.props の例。
 +自分独自のデフォルトの include path, lib path を設定しておくことができます。
 +VisualStudio の設定で @(MyIncludePath) や @(MyLibPath) を追加しておけば、build_def.props の編集だけで複数のプロジェクトにまたがる設定を変更することが可能。
 +また Compiler の CommandLine に $(MyCFlags) を追加しておけば、コンパイラオプションも一箇所で変更可能になります。
 +下記のように Release, Debug それぞれ異なる設定にすることも可能。
  
 +  - Configuration Properties → <nowiki>C/C++</nowiki> → General → Additional Include Directories の最後に @(MyIncludePath) を追加
 +  - Configuration Properties → <nowiki>C/C++</nowiki> → Command Line → Additional Options に $(MyCFlags) を追加
 +  - Configuration Properties → Linker → General → Additional Library Directories に @(MyLibPath) を追加
 +
 +<code xml>
 +<?xml version="1.0" encoding="utf-8"?>
 +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 +
 +<ItemGroup>
 +  <MyIncludePath Include="" />
 +  <MyLibPath Include="" />
 +</ItemGroup>
 +
 +<PropertyGroup>
 +  <MyCFlags Condition="'$(Configuration)'=='Debug'"></MyCFlags>
 +  <MyCFlags Condition="'$(Configuration)'=='Release'">-fp:fast -arch:AVX2</MyCFlags>
 +</PropertyGroup>
 +
 +</Project>
 +</code>
 +
 +
 +
 +build_def.targets の例。
 +vcxproj ファイルと同じ場所に CustomPreBuild.bat または CustomPostBuild.bat が存在していれば Build の前後に実行します。
 +VisualStudio 上から設定する Custom Build との違いは、bat ファイルが存在していなければ何もしないことです。
 +無駄なシェルの起動などを回避できます。
 +
 +<code xml>
 +<?xml version="1.0" encoding="utf-8"?>
 +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 +
 +<Target Name="CustomPreBuild" Condition="Exists('$(MSBuildProjectDirectory)/CustomPreBuild.bat')" BeforeTargets="Build">
 +  <Exec Command="$(MSBuildProjectDirectory)/CustomPreBuild.bat" />
 +</Target>
 +
 +<Target Name="CustomPostBuild" Condition="Exists('$(MSBuildProjectDirectory)/CustomPostBuild.bat')" AfterTargets="Build">
 +  <Exec Command="$(MSBuildProjectDirectory)/CustomPostBuild.bat" />
 +</Target>
 +
 +</Project>
 +</code>
  
  
行 577: 行 625:
     * Message Task を利用したデバッグ出力だけなら Normal で十分です。     * Message Task を利用したデバッグ出力だけなら Normal で十分です。
     * 条件判定の結果などより詳しい情報が必要なら Detailed にします。     * 条件判定の結果などより詳しい情報が必要なら Detailed にします。
 +
 +
 +
 +====== Command Line からの呼び出し ======
 +
 +
 +
 +<code>
 +msbuild /property:OutputDir=..\..\..\Binaries\DotNET\  /target:build  AutomationTool.csproj
 +</code>
  
  
  
  
opengl/visual_studio.1436105549.txt.gz · 最終更新: 2015/07/05 23:12 by oga

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki