scons: Use -Werror MSVC compatibility flags per-directory.
Matching what we already do with autotools builds. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -87,6 +87,25 @@ def createInstallMethods(env):
|
|||||||
env.AddMethod(install_shared_library, 'InstallSharedLibrary')
|
env.AddMethod(install_shared_library, 'InstallSharedLibrary')
|
||||||
|
|
||||||
|
|
||||||
|
def msvc2013_compat(env):
|
||||||
|
if env['gcc']:
|
||||||
|
env.Append(CCFLAGS = [
|
||||||
|
'-Werror=vla',
|
||||||
|
'-Werror=pointer-arith',
|
||||||
|
])
|
||||||
|
|
||||||
|
def msvc2008_compat(env):
|
||||||
|
msvc2013_compat(env)
|
||||||
|
if env['gcc']:
|
||||||
|
env.Append(CFLAGS = [
|
||||||
|
'-Werror=declaration-after-statement',
|
||||||
|
])
|
||||||
|
|
||||||
|
def createMSVCCompatMethods(env):
|
||||||
|
env.AddMethod(msvc2013_compat, 'MSVC2013Compat')
|
||||||
|
env.AddMethod(msvc2008_compat, 'MSVC2008Compat')
|
||||||
|
|
||||||
|
|
||||||
def num_jobs():
|
def num_jobs():
|
||||||
try:
|
try:
|
||||||
return int(os.environ['NUMBER_OF_PROCESSORS'])
|
return int(os.environ['NUMBER_OF_PROCESSORS'])
|
||||||
@@ -443,13 +462,6 @@ def generate(env):
|
|||||||
'-Wmissing-prototypes',
|
'-Wmissing-prototypes',
|
||||||
'-std=gnu99',
|
'-std=gnu99',
|
||||||
]
|
]
|
||||||
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
|
|
||||||
ccflags += [
|
|
||||||
'-Wpointer-arith',
|
|
||||||
]
|
|
||||||
cflags += [
|
|
||||||
'-Wdeclaration-after-statement',
|
|
||||||
]
|
|
||||||
if icc:
|
if icc:
|
||||||
cflags += [
|
cflags += [
|
||||||
'-std=gnu99',
|
'-std=gnu99',
|
||||||
@@ -617,6 +629,7 @@ def generate(env):
|
|||||||
# Custom builders and methods
|
# Custom builders and methods
|
||||||
env.Tool('custom')
|
env.Tool('custom')
|
||||||
createInstallMethods(env)
|
createInstallMethods(env)
|
||||||
|
createMSVCCompatMethods(env)
|
||||||
|
|
||||||
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes', 'glproto >= 1.4.13'])
|
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes', 'glproto >= 1.4.13'])
|
||||||
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1', 'xcb-dri2 >= 1.8'])
|
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1', 'xcb-dri2 >= 1.8'])
|
||||||
|
@@ -6,6 +6,8 @@ Import('*')
|
|||||||
|
|
||||||
env = env.Clone()
|
env = env.Clone()
|
||||||
|
|
||||||
|
env.MSVC2013Compat()
|
||||||
|
|
||||||
env.Append(CPPDEFINES = [
|
env.Append(CPPDEFINES = [
|
||||||
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
|
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
|
||||||
])
|
])
|
||||||
|
@@ -8,6 +8,10 @@ env.Append(CPPPATH = [
|
|||||||
'util',
|
'util',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
env = env.Clone()
|
||||||
|
|
||||||
|
env.MSVC2008Compat()
|
||||||
|
|
||||||
env.CodeGenerate(
|
env.CodeGenerate(
|
||||||
target = 'indices/u_indices_gen.c',
|
target = 'indices/u_indices_gen.c',
|
||||||
script = 'indices/u_indices_gen.py',
|
script = 'indices/u_indices_gen.py',
|
||||||
|
@@ -9,6 +9,8 @@ if not env['llvm']:
|
|||||||
|
|
||||||
env = env.Clone()
|
env = env.Clone()
|
||||||
|
|
||||||
|
env.MSVC2008Compat()
|
||||||
|
|
||||||
llvmpipe = env.ConvenienceLibrary(
|
llvmpipe = env.ConvenienceLibrary(
|
||||||
target = 'llvmpipe',
|
target = 'llvmpipe',
|
||||||
source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
|
source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
|
||||||
|
@@ -6,6 +6,8 @@ from sys import executable as python_cmd
|
|||||||
|
|
||||||
env = env.Clone()
|
env = env.Clone()
|
||||||
|
|
||||||
|
env.MSVC2013Compat()
|
||||||
|
|
||||||
env.Prepend(CPPPATH = [
|
env.Prepend(CPPPATH = [
|
||||||
'#include',
|
'#include',
|
||||||
'#src',
|
'#src',
|
||||||
|
@@ -2,6 +2,8 @@ Import('*')
|
|||||||
|
|
||||||
env = env.Clone()
|
env = env.Clone()
|
||||||
|
|
||||||
|
env.MSVC2013Compat()
|
||||||
|
|
||||||
env.Prepend(CPPPATH = [
|
env.Prepend(CPPPATH = [
|
||||||
'#include'
|
'#include'
|
||||||
])
|
])
|
||||||
|
@@ -8,6 +8,8 @@ Import('*')
|
|||||||
|
|
||||||
env = env.Clone()
|
env = env.Clone()
|
||||||
|
|
||||||
|
env.MSVC2013Compat()
|
||||||
|
|
||||||
env.Append(CPPDEFINES = [
|
env.Append(CPPDEFINES = [
|
||||||
'MAPI_MODE_UTIL',
|
'MAPI_MODE_UTIL',
|
||||||
])
|
])
|
||||||
|
@@ -10,6 +10,8 @@ from sys import executable as python_cmd
|
|||||||
|
|
||||||
env = env.Clone()
|
env = env.Clone()
|
||||||
|
|
||||||
|
env.MSVC2013Compat()
|
||||||
|
|
||||||
env.Append(CPPPATH = [
|
env.Append(CPPPATH = [
|
||||||
'#/src',
|
'#/src',
|
||||||
'#/src/mapi',
|
'#/src/mapi',
|
||||||
|
@@ -6,6 +6,8 @@ from sys import executable as python_cmd
|
|||||||
|
|
||||||
env = env.Clone()
|
env = env.Clone()
|
||||||
|
|
||||||
|
env.MSVC2008Compat()
|
||||||
|
|
||||||
env.Prepend(CPPPATH = [
|
env.Prepend(CPPPATH = [
|
||||||
'#include',
|
'#include',
|
||||||
'#src',
|
'#src',
|
||||||
|
Reference in New Issue
Block a user