Revert changes in wscript file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
diff --git a/wscript b/wscript
index 198b476..6d5579f 100644
--- a/wscript
+++ b/wscript
@@ -5,12 +5,10 @@ from waflib.Build import BuildContext, CleanContext, \
# Unix flags
CFLAGS_UNIX = ["-O2", "-Wall", "-Wextra"]
CFLAGS_UNIX_DBG = ['-g']
-CFLAGS_UNIX_PED = ['-pedantic', '-Werror']
# Windows MSVC flags
-CFLAGS_WIN32_COMMON = ['/TC', '/W4', '/nologo', '/Zi']
+CFLAGS_WIN32_COMMON = ['/TC', '/W4', '/WX', '/nologo', '/Zi']
CFLAGS_WIN32_RELEASE = ['/O2', '/MD']
-CFLAGS_WIN32_PED = ['/Wx']
# Note: /RTC* cannot be used with optimization on.
CFLAGS_WIN32_DBG = ['/Od', '/RTC1', '/RTCc', '/DEBUG', '/MDd']
@@ -33,10 +31,9 @@ PPC optimized version (ppc) or the SHA1 functions from OpenSSL (openssl)")
help='Select target architecture (ia64, x64, x86, x86_amd64, x86_ia64)')
opt.add_option('--without-sqlite', action='store_false', default=True,
dest='use_sqlite', help='Disable sqlite support')
- opt.add_option('--strict', action='store_true', default=False,
- help='Max warning level; treat warnings as errors')
def configure(conf):
+
# load the MSVC configuration flags
if conf.options.msvc:
conf.env['MSVC_VERSIONS'] = ['msvc ' + conf.options.msvc]
@@ -46,35 +43,20 @@ def configure(conf):
# default configuration for C programs
conf.load('compiler_c')
- debug = conf.options.debug
- pedantic = conf.options.strict
-
- if conf.env.CC_NAME == 'msvc':
- conf.env.CFLAGS = CFLAGS_WIN32_COMMON
- conf.env.LINKFLAGS = CFLAGS_WIN32_L
- if debug:
- conf.env.CFLAGS += CFLAGS_WIN32_DEBUG
- conf.env.LINKFLAGS += CFLAGS_WIN32_L_DBG
- else:
- conf.env.CFLAGS += CFLAGS_WIN32_RELEASE
-
- if pedantic:
- conf.ENV.CFLAGS += CFLAGS_WIN32_PED
-
- elif conf.env.CC_NAME == 'gcc':
- conf.env.CFLAGS = CFLAGS_UNIX
- if debug:
- conf.env.CFLAGS += CFLAGS_UNIX_DBG
- if pedantic:
- conf.env.CFLAGS += CFLAGS_UNIX_PED
-
-
- # Win32 Platform: MinGW and MSVC
+ dbg = conf.options.debug
+
+ conf.env.CFLAGS = CFLAGS_UNIX + (CFLAGS_UNIX_DBG if dbg else [])
+
if conf.env.DEST_OS == 'win32':
conf.env.PLATFORM = 'win32'
- conf.env.DEFINES += ['WIN32', '_DEBUG', '_LIB']
- # Unix-like platforms: Linux, Darwin, Cygwin, *BSD, etc
+ if conf.env.CC_NAME == 'msvc':
+ conf.env.CFLAGS = CFLAGS_WIN32_COMMON + \
+ (CFLAGS_WIN32_DBG if dbg else CFLAGS_WIN32_RELEASE)
+ conf.env.LINKFLAGS += CFLAGS_WIN32_L + \
+ (CFLAGS_WIN32_L_DBG if dbg else [])
+ conf.env.DEFINES += ['WIN32', '_DEBUG', '_LIB']
+
else:
conf.env.PLATFORM = 'unix'
conf.check_cc(lib='pthread', uselib_store='pthread')