|
@@ -158,6 +158,26 @@ this module:
|
|
|
|
|
|
env.add_source_files(env.modules_sources,"*.cpp") # just add all cpp files to the build
|
|
|
|
|
|
+With multiple sources, you can also add each file individually to a Python
|
|
|
+string list:
|
|
|
+
|
|
|
+.. code:: python
|
|
|
+
|
|
|
+ src_list = ["summator.cpp", "other.cpp", "etc.cpp"]
|
|
|
+ env.add_source_files(env.modules_sources, src_list)
|
|
|
+
|
|
|
+This allows for powerful possibilities using Python to contruct the file list
|
|
|
+using loops and logic statements. Look at some of the other modules that ship
|
|
|
+with Godot by default for examples.
|
|
|
+
|
|
|
+To add include directories for the compiler to look at you can append it to the
|
|
|
+environment's paths:
|
|
|
+
|
|
|
+.. code:: python
|
|
|
+
|
|
|
+ env.Append(CPPPATH="mylib/include") # this is a relative path
|
|
|
+ env.Append(CPPPATH="#myotherlib/include") # this is an 'absolute' path
|
|
|
+
|
|
|
If you want to add custom compiler flags when building your module, you need to clone
|
|
|
`env` first, so it won't add those flags to whole Godot build (which can cause errors).
|
|
|
Example `SCsub` with custom flags:
|