Xcode

Xcode is a free macOS-only IDE. You can download it from the Mac App Store.

プロジェクトのインポート

  • From Xcode's main screen create a new project using the Other > External Build System template.

../../../_images/xcode_1_create_external_build_project.png
  • Open your build targets from the Targets section and select the Info tab.

  • Fill out the form with the following settings:

    Build Tool

    A full path to the scons executable, e.g. /usr/local/bin/scons

    引数

    See ビルドシステムの説明 for a full list of arguments.

    Directory

    A full path to the Godot root folder

../../../_images/xcode_2_configure_scons.png
  • Add a Command Line Tool target which will be used for indexing the project by choosing File > New > Target....

../../../_images/xcode_3_add_new_target.png
  • Select OS X > Application > Command Line Tool.

../../../_images/xcode_4_select_command_line_target.png

注釈

このターゲットでコンパイルしてはいけないことがわかるように名前をつけてください (例: GodotXcodeIndex`)。

  • このターゲットの場合、 Build Settings タブを開き、 Header Search Paths を探します。

  • ヘッダ検索パス をGodotのルートフォルダへの絶対パスに設定してください。サブディレクトリも含める必要があります。そのためには、パスの最後にアスタリスク (**) を2つ追加してください。 例えば、 /Users/me/repos/godot-source/** のように。

  • Add the Godot source to the project by dragging and dropping it into the project file browser.

  • 外部ビルドシステムプロジェクトを作成する のチェックを外します。

../../../_images/xcode_5_after_add_godot_source_to_project.png
  • 次に、**Added folders**オプションで**Create groups**を選択し、**Add to targets**セクションにコマンドラインのインデックス対象 だけ あることを確認してください。

../../../_images/xcode_6_after_add_godot_source_to_project_2.png
  • Xcode will now index the files. This may take a few minutes.

  • Once Xcode is done indexing, you should have jump-to-definition, autocompletion, and full syntax highlighting.

Debugging the project

To enable debugging support you need to edit the external build target's build and run schemes.

  • 外部ビルドターゲットのスキームエディタを開きます。

  • ビルド > ポストアクション セクションにあります。

  • Add a new script run action

  • Under Provide build settings from select your project. This allows to reference the project directory within the script.

  • Xcodeが認識できる名前をバイナリに与えるスクリプトを作成します。例:

ln -f ${PROJECT_DIR}/godot/bin/godot.osx.tools.64 ${PROJECT_DIR}/godot/bin/godot
../../../_images/xcode_7_setup_build_post_action.png
  • 外部ビルドターゲットをビルドします。

  • スキームエディタを再度開き、 実行 を選択します。

../../../_images/xcode_8_setup_run_scheme.png
  • ビルド後のアクションスクリプトでリンクしたファイルに Executable を設定します。

  • Debug executable をチェックしてください。

  • You can add two arguments on the Arguments tab: the -e flag opens the editor instead of the project manager, and the --path argument tells the executable to open the specified project (must be provided as an absolute path to the project root, not the project.godot file).

すべてが動作していることを確認するには、 platform/osx/godot_main_osx.mm にブレークポイントを設定してプロジェクトを実行してください。

If you run into any issues, ask for help in one of Godot's community channels.