Xcode

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

Importation du projet

  • 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
    Arguments See Introduction au buildsystem 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

Note

Donnez-lui un nom pour que vous sachiez qu’il ne faut pas compiler avec cette cible (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/**.
  • Add the Godot source to the project by dragging and dropping it into the project file browser.
  • Décochez Create external build system project.
../../../_images/xcode_5_after_add_godot_source_to_project.png
  • Next select Create groups for the Added folders option and check only your command line indexing target in the Add to targets section.
../../../_images/xcode_6_after_add_godot_source_to_project_2.png
  • Xcode will now index the files. This may take a few minutes.
  • Une fois l’indexation de Xcode terminée, vous devriez avoir le saut à la définition, l’autocomplétion et la mise en évidence syntaxique complète.

Debugging the project

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

  • Ouvrez l’éditeur de schéma de la cible de compilation externe.
  • 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
../../../_images/xcode_7_setup_build_post_action.png
  • Compiler la cible de compilation externe.
  • Open the scheme editor again and select Run.
../../../_images/xcode_8_setup_run_scheme.png
  • Définissez l”Executable au fichier que vous avez lié dans votre script d’action post-compilation.
  • Check 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).

To check that everything is working, put a breakpoint in platform/osx/godot_main_osx.mm and run the project.

Si vous rencontrez des problèmes, demandez de l’aide sur l’un des canaux communautaires de Godot.