「MacでDirectX Shader Compilerをビルドする」の版間の差分

提供: MonoBook
ナビゲーションに移動 検索に移動
imported>Administrator
(ページの作成:「DirectX Shader CompilerMacLinuxでも使えるとのことなので試してみる。 == ビルドしてみる == DirectX Shader Compilerのビル…」)
 
3行目: 3行目:
 
== ビルドしてみる ==
 
== ビルドしてみる ==
 
[[DirectX Shader Compiler]]のビルドに必要なものをbrewで入れる。
 
[[DirectX Shader Compiler]]のビルドに必要なものをbrewで入れる。
  brew install python3 cmake ninja
+
<source lang="bash">
 +
  $ brew install python3 cmake ninja
 +
</source>
  
 
[[DirectX Shader Compiler]]の[[ソースコード]]を落としてくる。
 
[[DirectX Shader Compiler]]の[[ソースコード]]を落としてくる。
  git clone --recursive https://github.com/microsoft/DirectXShaderCompiler.git
+
<source lang="bash">
 +
  $ git clone --recursive https://github.com/microsoft/DirectXShaderCompiler.git
 +
</source>
  
 
cmakeでビルド準備。
 
cmakeでビルド準備。
  cd DirectXShaderCompiler
+
<source lang="bash">
  mkdir build
+
  $ cd DirectXShaderCompiler
  cd build
+
  $ mkdir build
  cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja $(cat ../utils/cmake-predefined-config-params)
+
  $ cd build
 +
  $ cmake .. $(cat ../utils/cmake-predefined-config-params) -DCMAKE_BUILD_TYPE=Release -DSPIRV_BUILD_TESTS=ON -GNinja
 +
</source>
  
 
ninjaでビルド実行。
 
ninjaでビルド実行。
 
メッチャ時間がかかる。
 
メッチャ時間がかかる。
  ninja
+
<source lang="bash">
 
+
  $ ninja
 +
</source>
 
おしまい
 
おしまい
  
 
== 動かしてみる ==
 
== 動かしてみる ==
ビルドが正常に完了すればbinディレクトリに実行ファイルが出来上がっているはず。
+
ビルドが正常に完了すればbinディレクトリにdxc実行ファイルが出来上がっているはず。
  cd bin
+
  $ cd bin
  
 
とりあえずusageを出してみる。
 
とりあえずusageを出してみる。
  ./dxc -help
+
  $ ./dxc -help
  
 
こいつ動くぞ。
 
こいつ動くぞ。

2020年3月30日 (月) 08:38時点における版

DirectX Shader CompilerMacLinuxでも使えるとのことなので試してみる。

ビルドしてみる

DirectX Shader Compilerのビルドに必要なものをbrewで入れる。

 $ brew install python3 cmake ninja

DirectX Shader Compilerソースコードを落としてくる。

 $ git clone --recursive https://github.com/microsoft/DirectXShaderCompiler.git

cmakeでビルド準備。

 $ cd DirectXShaderCompiler
 $ mkdir build
 $ cd build
 $ cmake .. $(cat ../utils/cmake-predefined-config-params) -DCMAKE_BUILD_TYPE=Release -DSPIRV_BUILD_TESTS=ON -GNinja

ninjaでビルド実行。 メッチャ時間がかかる。

 $ ninja

おしまい

動かしてみる

ビルドが正常に完了すればbinディレクトリにdxc実行ファイルが出来上がっているはず。

$ cd bin

とりあえずusageを出してみる。

$ ./dxc -help

こいつ動くぞ。

関連項目