Selaa lähdekoodia

Compiling: Clarify instructions on compiling with Mono

Fixes godotengine/godot#20384.
Rémi Verschelde 7 vuotta sitten
vanhempi
commit
ce2655b7f7
1 muutettua tiedostoa jossa 27 lisäystä ja 8 poistoa
  1. 27 8
      development/compiling/compiling_with_mono.rst

+ 27 - 8
development/compiling/compiling_with_mono.rst

@@ -12,19 +12,19 @@ Requirements
 - MSBuild
 - pkg-config
 
-Environment Variables
+Environment variables
 ---------------------
 
 By default, SCons will try to find Mono in the Windows Registry on Windows or via ``pkg-config`` on other platforms. You can specify a different installation directory by using the following environment variables for the respective ``bits`` option: ``MONO32_PREFIX`` and ``MONO64_PREFIX``.
 
 The specified directory must contain the subdirectories ``bin``, ``include``, and ``lib``.
 
-Enable Mono Module
---------------------
+Enable the Mono module
+----------------------
 
 By default, the mono module is disabled for builds. To enable it you can pass the option ``module_mono_enabled=yes`` to your SCons command.
 
-Generate The Glue
+Generate the glue
 -------------------
 
 The glue sources are the wrapper functions that will be called by managed methods. These source files must be generated before building your final binaries. In order to generate them, first, you must build a temporary Godot binary with the options ``tools=yes`` and ``mono_glue=no``:
@@ -37,17 +37,36 @@ After the build finishes, you need to run the compiled executable with the param
 
 ::
 
-    godot --generate-mono-glue modules/mono/glue
+    <godot_binary> --generate-mono-glue modules/mono/glue
 
-This command will tell Godot to generate the file *modules/mono/glue/mono_glue.gen.cpp*. Once this file is generated, you can build Godot for all the desired targets without the need to repeat this process.
+This command will tell Godot to generate the file ``modules/mono/glue/mono_glue.gen.cpp``.
+Once this file is generated, you can build Godot for all the desired targets without the need to repeat this process.
 
-As always, ``godot`` refers to the compiled Godot binary, so if it isn't in your PATH, you need to give the full path to the executable, e.g. if it is located in the ``bin`` subfolder, it becomes ``bin/godot``.
+``<godot_binary>`` refers to the tools binary you compiled above with the Mono module enabled.
+Its exact name will differ based on your system and configuration, but should be of the form ``bin/godot.<platform>.tools.<bits>.mono``, e.g. ``bin/godot.x11.tools.64.mono`` or ``bin/godot.windows.tools.64.exe``.
+Be especially aware of the **.mono** suffix! If you compiled Godot without Mono support previously, you might have similarly named binaries without this suffix which can't be used to generate the Mono glue.
 
 Notes
 ^^^^^
 -  **Do not** build your final binaries with ``mono_glue=no``. This disables C# scripting. This option must be used only for the temporary binary that will generate the glue. Godot will print a warning at startup if it was built without the glue sources.
 -  The glue sources must be regenerated every time the ClassDB bindings changes. That is, for example, when a new method is added to ClassDB or one of the parameter of such a method changes. Godot will print an error at startup if there is an API mismatch between ClassDB and the glue sources.
 
+Rebuild with Mono glue
+----------------------
+
+Once you have generated the Mono glue, you can build the final binary with ``mono_glue=yes``.
+It's the default value for ``mono_glue`` so you can also omit it. You can build the Mono-enabled editor:
+
+::
+
+    scons p=<platform> tools=yes module_mono_enabled=yes mono_glue=yes
+
+And Mono-enabled export templates:
+
+::
+
+    scons p=<platform> tools=no module_mono_enabled=yes mono_glue=yes
+
 Examples
 --------
 
@@ -67,7 +86,7 @@ Example (Windows)
     scons p=windows target=debug tools=no module_mono_enabled=yes
     scons p=windows target=release tools=no module_mono_enabled=yes
 
-Example (x11)
+Example (X11)
 ^^^^^^^^^^^^^
 ::