File: SConscript.target.win32

package info (click to toggle)
alljoyn-thin-client-1509 15.09a-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,240 kB
  • sloc: ansic: 55,937; cpp: 2,995; python: 361; sh: 174; makefile: 39
file content (61 lines) | stat: -rw-r--r-- 2,324 bytes parent folder | download | duplicates (2)
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
import os
import platform

Import('env')

default_target_os = 'win7'
allowed_target_oss = ('win7', 'win10')

if platform.machine() == 'x86_64':
    default_target_cpu = 'x86_64'
else:
    default_target_cpu = 'x86'
allowed_target_cpus = ('x86', 'x86_64', 'arm')

# Target specific SCons command line variables
default_msvc_version = os.environ.get('AJ_MSVC_VERSION', '12.0')
supported_msvc_versions = [ '8.0', '9.0', '10.0', '11.0', '11.0Exp', '12.0', '12.0Exp', '14.0', '14.0Exp' ]

vars = Variables()
vars.Add(EnumVariable('OS', 'Target OS', default_target_os, allowed_values = allowed_target_oss))
vars.Add(EnumVariable('CPU', 'Target CPU', default_target_cpu, allowed_values = allowed_target_cpus))
vars.Add(EnumVariable('MSVC_VERSION', 'MSVC compiler version - Windows', default_msvc_version, allowed_values = supported_msvc_versions))
vars.Add(BoolVariable('FORCE32', 'Force building 32 bit on 64 bit architecture', os.environ.get('AJ_FORCE32', False)))
vars.Add(BoolVariable('NO_AUTH', "Compile in authentication mechanism's to the code base", os.environ.get('AJ_NO_AUTH', False)))
vars.Update(env)
Help(vars.GenerateHelpText(env))

# Platform libraries
env.Append(LIBS = ['advapi32'])

# Compiler flags
env.Append(CFLAGS = ['/J', '/W3', '/nologo'])
env.Append(CPPDEFINES = ['_CRT_SECURE_NO_WARNINGS', 'AJ_MAIN'])
if env['FORCE32']:
    env['TARGET_ARCH'] = 'x86'
if env['NO_AUTH']:
    env.Append(CPPDEFINES = ['TEST_DISABLE_SECURITY'])

# Debug/Release Variants
if env['VARIANT'] == 'debug':
    env.Append(CFLAGS = ['/Zi', '/Od', '/MDd'])
    env.Append(CPPDEFINES = ['_DEBUG'])
    env.Append(LINKFLAGS = ['/debug'])
else:
   env.Append(CFLAGS = ['/Gy', '/O1', '/GF', '/MD'])
   env.Append(LINKFLAGS = ['/opt:ref', '/NODEFAULTLIB:libcmt.lib'])

env['connectivity_options'] = ['tcp', 'ardp']

# Support running on Win7 and newer Windows versions.
env.Append(CPPDEFINES = [('_WIN32_WINNT', '_WIN32_WINNT_WIN7')])

# This is needed in order to build with Scons and Visual Studio multiple targets
# in parallel using the -j option. See alljoyn\build_core\conf\windows\SConscript.
env['CCPDBFLAGS'] = '/Z7'
env['PDB'] = '${TARGET.base}.pdb'
env.Append(LINKFLAGS=['/PDB:${TARGET.base}.pdb'])

# Large Memory Platform
env.Append(CPPDEFINES = ['AJ_NVRAM_SIZE=64000'])
env.Append(CPPDEFINES = ['AJ_NUM_REPLY_CONTEXTS=8'])