summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct48
1 files changed, 35 insertions, 13 deletions
diff --git a/SConstruct b/SConstruct
index 17cf779d4a..92dc4d9da2 100644
--- a/SConstruct
+++ b/SConstruct
@@ -125,7 +125,7 @@ opts.Add(BoolVariable('verbose', "Enable verbose output for the compilation", Fa
opts.Add(BoolVariable('progress', "Show a progress indicator during compilation", True))
opts.Add(EnumVariable('warnings', "Set the level of warnings emitted during compilation", 'all', ('extra', 'all', 'moderate', 'no')))
opts.Add(BoolVariable('werror', "Treat compiler warnings as errors. Depends on the level of warnings set with 'warnings'", False))
-opts.Add(BoolVariable('dev', "If yes, alias for verbose=yes warnings=all", False))
+opts.Add(BoolVariable('dev', "If yes, alias for verbose=yes warnings=extra werror=yes", False))
opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '')
opts.Add(BoolVariable('vsproj', "Generate a Visual Studio solution", False))
opts.Add(EnumVariable('macports_clang', "Build using Clang from MacPorts", 'no', ('no', '5.0', 'devel')))
@@ -145,7 +145,7 @@ opts.Add(BoolVariable('builtin_libtheora', "Use the built-in libtheora library",
opts.Add(BoolVariable('builtin_libvorbis', "Use the built-in libvorbis library", True))
opts.Add(BoolVariable('builtin_libvpx', "Use the built-in libvpx library", True))
opts.Add(BoolVariable('builtin_libwebp', "Use the built-in libwebp library", True))
-opts.Add(BoolVariable('builtin_libwebsockets', "Use the built-in libwebsockets library", True))
+opts.Add(BoolVariable('builtin_wslay', "Use the built-in wslay library", True))
opts.Add(BoolVariable('builtin_mbedtls', "Use the built-in mbedTLS library", True))
opts.Add(BoolVariable('builtin_miniupnpc', "Use the built-in miniupnpc library", True))
opts.Add(BoolVariable('builtin_opus', "Use the built-in Opus library", True))
@@ -254,8 +254,9 @@ if selected_platform in platform_list:
env = env_base.Clone()
if env['dev']:
- env["warnings"] = "all"
env['verbose'] = True
+ env['warnings'] = "extra"
+ env['werror'] = True
if env['vsproj']:
env.vs_incs = []
@@ -326,6 +327,8 @@ if selected_platform in platform_list:
env.Append(CCFLAGS=['/EHsc'])
if (env["werror"]):
env.Append(CCFLAGS=['/WX'])
+ # Force to use Unicode encoding
+ env.Append(MSVC_FLAGS=['/utf8'])
else: # Rest of the world
shadow_local_warning = []
all_plus_warnings = ['-Wwrite-strings']
@@ -336,16 +339,15 @@ if selected_platform in platform_list:
shadow_local_warning = ['-Wshadow-local']
if (env["warnings"] == 'extra'):
- # FIXME: enable -Wclobbered once #26351 is fixed
- # FIXME: enable -Wduplicated-branches once #27594 is merged
# Note: enable -Wimplicit-fallthrough for Clang (already part of -Wextra for GCC)
# once we switch to C++11 or later (necessary for our FALLTHROUGH macro).
env.Append(CCFLAGS=['-Wall', '-Wextra', '-Wno-unused-parameter']
+ all_plus_warnings + shadow_local_warning)
env.Append(CXXFLAGS=['-Wctor-dtor-privacy', '-Wnon-virtual-dtor'])
if methods.using_gcc(env):
- env.Append(CCFLAGS=['-Wno-clobbered', '-Walloc-zero',
- '-Wduplicated-cond', '-Wstringop-overflow=4', '-Wlogical-op'])
+ env.Append(CCFLAGS=['-Walloc-zero',
+ '-Wduplicated-branches', '-Wduplicated-cond',
+ '-Wstringop-overflow=4', '-Wlogical-op'])
env.Append(CXXFLAGS=['-Wnoexcept', '-Wplacement-new=1'])
version = methods.get_compiler_version(env)
if version != None and version[0] >= '9':
@@ -397,6 +399,7 @@ if selected_platform in platform_list:
sys.modules.pop('detect')
env.module_list = []
+ env.module_icons_paths = []
env.doc_class_path = {}
for x in module_list:
@@ -419,13 +422,22 @@ if selected_platform in platform_list:
if (can_build):
config.configure(env)
env.module_list.append(x)
+
+ # Get doc classes paths (if present)
try:
- doc_classes = config.get_doc_classes()
- doc_path = config.get_doc_path()
- for c in doc_classes:
- env.doc_class_path[c] = "modules/" + x + "/" + doc_path
+ doc_classes = config.get_doc_classes()
+ doc_path = config.get_doc_path()
+ for c in doc_classes:
+ env.doc_class_path[c] = "modules/" + x + "/" + doc_path
except:
pass
+ # Get icon paths (if present)
+ try:
+ icons_path = config.get_icons_path()
+ env.module_icons_paths.append("modules/" + x + "/" + icons_path)
+ except:
+ # Default path for module icons
+ env.module_icons_paths.append("modules/" + x + "/" + "icons")
sys.path.remove(tmppath)
sys.modules.pop('config')
@@ -510,13 +522,23 @@ if selected_platform in platform_list:
env.AppendUnique(CPPDEFINES=[header[1]])
elif selected_platform != "":
+ if selected_platform == "list":
+ print("The following platforms are available:\n")
+ else:
+ print('Invalid target platform "' + selected_platform + '".')
+ print("The following platforms were detected:\n")
- print("Invalid target platform: " + selected_platform)
- print("The following platforms were detected:")
for x in platform_list:
print("\t" + x)
+
print("\nPlease run SCons again and select a valid platform: platform=<string>")
+ if selected_platform == "list":
+ # Exit early to suppress the rest of the built-in SCons messages
+ sys.exit(0)
+ else:
+ sys.exit(255)
+
# The following only makes sense when the env is defined, and assumes it is
if 'env' in locals():
screen = sys.stdout