2 # This script includes windows specific config (MSVS/MSVC)
10 # TODO: re-enable warnings, especially: 4244, 4267, 4365
11 env.AppendUnique(CXXFLAGS=[
12 '/wd4244', # C4244 conversion from one type to another type results in a possible loss of data.
13 '/wd4267', # C4267 conversion from size_t to a smaller type.
14 '/wd4355', # C4355 'this' used in base member initializer list.
15 '/wd4800', # C4800 forcing value to bool 'true' or 'false'.
16 '/wd4996', # C4996 deprecated declaration.
17 '/wd4820', # C4820 added padding to the end of a struct.
18 '/wd4514', # C4514 unreferenced inline function has been removed
19 '/wd4365', # C4365 signed/unsigned mismatch
20 '/wd4503']) # C4503 decorated name length exceeded, name was truncated
22 env.AppendUnique(CCFLAGS=['/EHsc'])
24 vs_version = env['MSVC_VERSION']
26 # Enable special exports for unit test purposes
27 if env.get('TEST') == '1':
28 env.AppendUnique(CPPDEFINES = ['ENABLE_TEST_EXPORTS'])
29 # Set release/debug flags
30 if env.get('RELEASE'):
31 env.AppendUnique(CCFLAGS = ['/MD', '/O2', '/GF'])
32 env.AppendUnique(CPPDEFINES = ['NDEBUG'])
33 elif env.get('TARGET_ARCH') in ['x86', 'x86_64'] or "14.0" in vs_version:
34 env.AppendUnique(CCFLAGS = ['/MDd', '/Od', '/ZI', '/RTC1', '/Gm'])
35 env.AppendUnique(LINKFLAGS = ['/debug'])
37 env.AppendUnique(CCFLAGS = ['/MDd', '/Od', '/Zi', '/RTC1', '/Gm'])
38 env.AppendUnique(LINKFLAGS = ['/debug'])
39 env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
40 env.AppendUnique(PATH = os.environ['PATH'])
42 elif env['CC'] == 'gcc':
43 print "\nError: gcc not supported on Windows. Use Visual Studio!\n"