Xcode¶
Xcode is a free macOS-only IDE. You can download it from the Mac App Store.
Importando o projeto¶
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.
Preencha o formulário com as seguintes configurações:
Construir ferramenta
A full path to the scons executable, e.g. /usr/local/bin/scons
Argumentos
Veja Introduction to the buildsystem para uma lista completa de parametros.
Diretório
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.
Nota
Name it something so you know not to compile with this target (e.g. GodotXcodeIndex
).
For this target open the Build Settings tab and look for Header Search Paths.
Set Header Search Paths to the absolute path to the Godot root folder. You need to include subdirectories as well. To achieve that, add two two asterisks (
**
) to the end of the path, e.g./Users/me/repos/godot-source/**
.Adicione o código-fonte do Godot ao projeto arrastando-o e soltando-o no navegador de arquivos do projeto.
Uncheck Create external build system project.
Next select Create groups for the Added folders option and check only your command line indexing target in the Add to targets section.
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.
Depurando o projeto¶
To enable debugging support you need to edit the external build target's build and run schemes.
Open the scheme editor of the external build target.
Locate the Build > Post Actions section.
Add a new script run action
Under Provide build settings from select your project. This allows to reference the project directory within the script.
Create a script that will give the binary a name that Xcode can recognize, e.g.:
ln -f ${PROJECT_DIR}/godot/bin/godot.osx.tools.64 ${PROJECT_DIR}/godot/bin/godot
Build the external build target.
Open the scheme editor again and select Run.
Set the Executable to the file you linked in your post-build action script.
Marque Depurar executável.
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).
To check that everything is working, put a breakpoint in platform/osx/godot_main_osx.mm
and
run the project.
Se você se deparar com qualquer problema, peça ajuda em um dos canais da comunidade do Godot.