Skip to content

Instantly share code, notes, and snippets.

@tana
Last active October 6, 2023 12:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tana/251fe532640df211658e71e1595caa08 to your computer and use it in GitHub Desktop.
Save tana/251fe532640df211658e71e1595caa08 to your computer and use it in GitHub Desktop.
ラズパイでSiv3D

前提条件

  • Raspberry Pi 4 Model B
    • OpenGL ES 3.1はPi 4でないと動かないため
  • Raspbian bullseye (64ビット、32ビット両対応。ただし32ビットでは検証不足)

手順

  1. aptから入れられる範囲で依存パッケージを入れる
    sudo apt install ninja-build libasound2-dev libavcodec-dev libavformat-dev libavutil-dev libboost-dev libcurl4-openssl-dev libgtk-3-dev libgif-dev libglu1-mesa-dev libharfbuzz-dev libmpg123-dev libopencv-dev libopus-dev libopusfile-dev libsoundtouch-dev libswresample-dev libtiff-dev libturbojpeg0-dev libvorbis-dev libwebp-dev libxft-dev uuid-dev xorg-dev clang cmake
    • GCCではなくClangコンパイラが必要(32ビットではGCCでもコンパイル可能な可能性あり。要検証)
    • cmakeも標準では入っていないので入れる必要あり
  2. Siv3Dのビルド
    # ホームディレクトリに戻ってから
    git clone https://github.com/tana/OpenSiv3D.git # 公式ではまだ対応していないため、改造版リポジトリを使用
    cd OpenSiv3D/
    git switch linux-arm-samedir  # ARM対応コードを含むブランチに切り替え
    mkdir Linux/build
    cd Linux/build/
    CC=clang CXX=clang++ cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
    cmake --build . -j2  # メモリ不足で止まるので2並列に制限
  3. サンプルアプリのビルド・実行
    cd ../App/
    mkdir build
    cd build/
    # SIV3D_RENDERER_BACKENDでOpenGLとOpenGL ESを切り替えられるようになっている
    CC=clang CXX=clang++ cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSIV3D_RENDERER_BACKEND=OpenGLES ..
    cmake --build .
    ../Siv3DTest  # 実行
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment