Make strict compilation under scons behave like cmake
This adds -Wold-style-cast to the CCFLAGS when compiling everything but lua. Lua requires an exception from the flags and there's thus a workaround added.
This commit is contained in:
parent
dc9db2e830
commit
d350d91c40
2 changed files with 6 additions and 2 deletions
|
@ -511,7 +511,7 @@ for env in [test_env, campaignd_env, client_env, env]:
|
|||
env.AppendUnique(CXXFLAGS = ["-fopenmp"], LIBS = ["gomp"])
|
||||
|
||||
if env['strict']:
|
||||
env.AppendUnique(CCFLAGS = Split("-Werror $(-Wno-unused-local-typedefs$)"))
|
||||
env.AppendUnique(CCFLAGS = Split("-Werror -Wold-style-cast $(-Wno-unused-local-typedefs$)"))
|
||||
|
||||
env["OPT_FLAGS"] = "-O2"
|
||||
env["DEBUG_FLAGS"] = Split("-O0 -DDEBUG -ggdb3")
|
||||
|
|
|
@ -37,8 +37,12 @@ linit.cpp
|
|||
""")
|
||||
liblua = env.Library("lua", lua_sources,
|
||||
# Silence some Clang-specific warnings due to extra parentheses in if statements when comparing.
|
||||
CCFLAGS = ["$CCFLAGS", "clang" in env["CXX"] and Split("-Wno-parentheses-equality -Wno-pointer-bool-conversion") or []],
|
||||
CCFLAGS = ["$CCFLAGS", "clang" in env["CXX"] and Split("-Wno-parentheses-equality -Wno-pointer-bool-conversion") or [], "strict" in env and Split("-Wno-old-style-cast -Wno-useless-cast") or []],
|
||||
CCCOM = env["CXXCOM"],
|
||||
CPPPATH = ["$CPPPATH", Dir(".").srcnode()],
|
||||
CPPDEFINES = ["$CPPDEFINES", env["PLATFORM"] != "win32" and "LUA_USE_POSIX" or []])
|
||||
|
||||
#if env['strict']:
|
||||
# env.AppendUnique(CCFLAGS = Split("-Wno-old-style-cast -Wno-useless-cast"))
|
||||
|
||||
Return("liblua")
|
||||
|
|
Loading…
Add table
Reference in a new issue