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.
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
Add a Command Line Tool target which will be used for indexing the project by choosing File > New > Target....
Select OS X > Application > Command Line Tool.
注釈
このターゲットでコンパイルしてはいけないことがわかるように名前をつけてください (例: 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.
外部ビルドシステムプロジェクトを作成する のチェックを外します。
次に、**Added folders**オプションで**Create groups**を選択し、**Add to targets**セクションにコマンドラインのインデックス対象 だけ あることを確認してください。
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
外部ビルドターゲットをビルドします。
スキームエディタを再度開き、 実行 を選択します。
ビルド後のアクションスクリプトでリンクしたファイルに 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 theproject.godot
file).
すべてが動作していることを確認するには、 platform/osx/godot_main_osx.mm
にブレークポイントを設定してプロジェクトを実行してください。
If you run into any issues, ask for help in one of Godot's community channels.