mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-03 05:48:42 +03:00
Remove obsolete CXXFLAGS override in Custom modules in C++
This line is actually harmful now that Godot defaults to C++17.
(cherry picked from commit 8c4bd39379)
This commit is contained in:
committed by
Rémi Verschelde
parent
e39c168184
commit
09de57369f
@@ -182,8 +182,8 @@ environment's paths:
|
||||
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:
|
||||
``env`` first, so it won't add those flags to whole Godot build (which can cause errors).
|
||||
Example ``SCsub`` with custom flags:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -193,8 +193,11 @@ Example `SCsub` with custom flags:
|
||||
|
||||
module_env = env.Clone()
|
||||
module_env.add_source_files(env.modules_sources, "*.cpp")
|
||||
module_env.Append(CCFLAGS=['-O2']) # Flags for C and C++ code
|
||||
module_env.Append(CXXFLAGS=['-std=c++11']) # Flags for C++ code only
|
||||
# Append CCFLAGS flags for both C and C++ code.
|
||||
module_env.Append(CCFLAGS=['-O2'])
|
||||
# If you need to, you can:
|
||||
# - Append CFLAGS for C code only.
|
||||
# - Append CXXFLAGS for C++ code only.
|
||||
|
||||
And finally, the configuration file for the module, this is a simple
|
||||
python script that must be named ``config.py``:
|
||||
|
||||
Reference in New Issue
Block a user