SCons: Enable C++11 on the whole codebase

**Important:** This does not mean *yet* that C++11 features should be used
in contributions to Godot's codebase.

For now this change is done solely for feature branches working on Vulkan
support and GDScript typed instruction sets for Godot 4.0, which will both
use C++11 features and are based on the master branch.

The plan is to start porting the codebase to C++11 after Godot 3.2 is
released, following upcoming guidelines on the subset of new features that
should be used, and when/how to use them.

We will advertise clearly when C++11 contributions are open, especially
once we start a coordinated effort to port Godot's massive codebase. In the
meantime, please bear with us and good ol' C++03. :)
This commit is contained in:
Rémi Verschelde 2019-07-22 16:57:24 +02:00
parent f03c1c8d4f
commit 5dae2ea777
6 changed files with 4 additions and 21 deletions

View file

@ -311,6 +311,10 @@ if selected_platform in platform_list:
# must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11)
detect.configure(env)
# Enable C++11 support
if not env.msvc:
env.Append(CXXFLAGS=['-std=c++11'])
# Configure compiler warnings
if env.msvc:
# Truncations, narrowing conversions, signed/unsigned comparisons...

View file

@ -72,11 +72,6 @@ env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_X3D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_SINGLETHREADED'])
if (not env.msvc):
env_assimp.Append(CXXFLAGS=['-std=c++11'])
elif (env.msvc == False and env['platform'] == 'windows'):
env_assimp.Append(LDFLAGS=['-pthread'])
if(env['platform'] == 'windows'):
env_assimp.Append(CPPDEFINES=['PLATFORM_WINDOWS'])
env_assimp.Append(CPPDEFINES=[('PLATFORM', 'WINDOWS')])

View file

@ -29,10 +29,6 @@ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_etc.Prepend(CPPPATH=[thirdparty_dir])
# upstream uses c++11
if not env.msvc:
env_etc.Append(CXXFLAGS="-std=c++11")
env_thirdparty = env_etc.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)

View file

@ -26,10 +26,6 @@ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_vhacd.Prepend(CPPPATH=[thirdparty_dir + "/inc"])
# upstream uses c++11
if not env.msvc:
env_vhacd.Append(CXXFLAGS="-std=c++11")
env_thirdparty = env_vhacd.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)

View file

@ -17,10 +17,6 @@ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_webm.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"])
# upstream uses c++11
if (not env_webm.msvc):
env_webm.Append(CXXFLAGS="-std=c++11")
# also requires libogg, libvorbis and libopus
if env['builtin_libogg']:
env_webm.Prepend(CPPPATH=["#thirdparty/libogg"])

View file

@ -15,10 +15,6 @@ if env['builtin_xatlas']:
env_xatlas_unwrap.Prepend(CPPPATH=[thirdparty_dir])
# upstream uses c++11
if (not env.msvc):
env_xatlas_unwrap.Append(CXXFLAGS="-std=c++11")
env_thirdparty = env_xatlas_unwrap.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)