「MacOSにglslangを入れる」の版間の差分

編集の要約なし
編集の要約なし
6行目: 6行目:


== 手順 ==
== 手順 ==
まず[[glslang]]の[[ソースコード]]を取得する。
ビルドシステムを入れる
<source lang="bash">
<source lang="bash">
  git clone https://github.com/KhronosGroup/glslang.git
  % brew install python3 cmake ninja
</source>
 
[[glslang]]の[[ソースコード]]を取得する。
<source lang="bash">
% git clone https://github.com/KhronosGroup/glslang.git
</source>
</source>


次に[[Google Test]]を落としてくる。[[git]]のサブモジュール設定はされていないので必ず手動でやる必要がある。
次に[[Google Test]]を落としてくる。[[git]]のサブモジュール設定はされていないので必ず手動でやる必要がある。
<source lang="bash">
<source lang="bash">
  cd glslang
  % cd glslang
  git clone https://github.com/google/googletest.git External/googletest
  % git clone https://github.com/google/googletest.git External/googletest
</source>
</source>


その他のサブモジュールを準備するスクリプトを実行する。
その他のサブモジュールを準備するスクリプトを実行する。
<source lang="bash">
<source lang="bash">
  ./update_glslang_sources.py
  % ./update_glslang_sources.py
</source>
</source>


[[cmake]]で[[Makefile]]を生成する。
[[cmake]]で[[Makefile]]を生成する。
<source lang="bash">
<source lang="bash">
  mkdir build
  % mkdir build
  cd build
  % cd build
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -GNinja
  % cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -GNinja
</source>
</source>


[[ninja]]を実行する。
[[ninja]]を実行する。
<source lang="bash">
<source lang="bash">
  ninja
  % ninja
</source>
</source>


動作確認を確認する。ビルド成果物は「install」ディレクトリの中にある。
動作確認を確認する。ビルド成果物は「install」ディレクトリの中にある。
<source lang="bash">
<source lang="bash">
  cd install/bin
  % cd install/bin
  ./glslangValidator
  % ./glslangValidator
<source lang="bash">
<source lang="bash">