File: SConscript

package info (click to toggle)
alljoyn-core-1509 15.09a-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 31,280 kB
  • sloc: cpp: 221,760; java: 40,806; objc: 17,659; ansic: 5,152; xml: 4,203; cs: 3,417; python: 1,775; sh: 1,139; makefile: 210; perl: 72
file content (111 lines) | stat: -rw-r--r-- 4,757 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Copyright AllSeen Alliance. All rights reserved.
#
#    Permission to use, copy, modify, and/or distribute this software for any
#    purpose with or without fee is hereby granted, provided that the above
#    copyright notice and this permission notice appear in all copies.
#
#    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
#    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
#    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
#    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
#    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
#    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
#    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

import os
Import('env')
from os.path import basename

# Bullseye code coverage for 'debug' builds.
if env['VARIANT'] == 'debug':
    if env.has_key('BULLSEYE_BIN'):
        env.PrependENVPath('PATH', env.get('BULLSEYE_BIN'))
        if not os.environ.has_key('COVFILE'):
            print 'Error: COVFILE environment variable must be set'
            if not GetOption('help'):
                Exit(1)
        else:
            env.PrependENVPath('COVFILE', os.environ['COVFILE'])

# Make alljoyn C++ dist a sub-directory of the alljoyn dist.
env['OBJDIR_COMMON'] = env['OBJDIR'] + '/common'

# All AllJoyn subprojects have access to common so add the include path to the global environment
env.Append(CPPPATH = [env.Dir('inc')])

commonenv = env.Clone()

# Variant settings
commonenv.VariantDir('$OBJDIR_COMMON', 'src', duplicate = 0)
commonenv.VariantDir('$OBJDIR_COMMON/os', 'os/${OS_GROUP}', duplicate = 0)
commonenv.VariantDir('$OBJDIR_COMMON/crypto', 'crypto/${CRYPTO}', duplicate = 0)
# If we're using CNG, use the CNG ECC provider code. Anything else, use the generic provider.
if env['CRYPTO'] == 'cng':
    commonenv.VariantDir('$OBJDIR_COMMON/crypto/ECC', 'crypto/ECC/cng', duplicate = 0)
else:
    commonenv.VariantDir('$OBJDIR_COMMON/crypto/ECC', 'crypto/ECC/generic', duplicate = 0)

commonenv.Append(CPPPATH = ['crypto'])

# Setup dependent include directories
hdrs = { 'qcc': commonenv.File(['inc/qcc/Log.h',
                                'inc/qcc/Debug.h',
                                'inc/qcc/ManagedObj.h',
                                'inc/qcc/Mutex.h',
                                'inc/qcc/String.h',
                                'inc/qcc/StringUtil.h',
                                'inc/qcc/atomic.h',
                                'inc/qcc/GUID.h',
                                'inc/qcc/CryptoECC.h',
                                'inc/qcc/KeyInfo.h',
                                'inc/qcc/KeyInfoECC.h',
                                'inc/qcc/CertificateECC.h',
                                'inc/qcc/platform.h']),
         'qcc/${OS_GROUP}': commonenv.File(['inc/qcc/${OS_GROUP}/atomic.h',
                                            'inc/qcc/${OS_GROUP}/platform_types.h']) }

if commonenv['OS_GROUP'] == 'windows':
    hdrs['qcc/${OS_GROUP}'] += commonenv.File(['inc/qcc/${OS_GROUP}/mapping.h'])


# under normal build conditions the Status.xml found in alljoyn_core is used to
# build Status.h and Status.cc.  If we are building the code in common independent
# of the alljoyn_core we will have to create Status.h and Status.cc for common.
status_obj = [];
if commonenv.has_key('BUILD_COMMON_STATUS'):
    status_src, status_hdr = commonenv.Status('$OBJDIR_COMMON/Status')
    status_obj = commonenv.Object(status_src)
    commonenv.Append(CPPPATH = ['#' + os.path.dirname(str(status_hdr))])
else:
    # allow common to "#include <alljoyn/Status.h>" when building all of AllJoyn
    commonenv.Append(CPPPATH = ['$DISTDIR/cpp/inc'])

if commonenv['CRYPTO'] == 'builtin':
    commonenv.Append(CPPPATH = [env.Dir('../external/sha2'), env.Dir('../external/sha1')])

# Build the sources
status_src = ['Status.cc']


srcs = commonenv.Glob('$OBJDIR_COMMON/*.cc') + commonenv.Glob('$OBJDIR_COMMON/os/*.cc') + commonenv.Glob('$OBJDIR_COMMON/crypto/*.cc') + commonenv.Glob('$OBJDIR_COMMON/crypto/ECC/*.cc')

# Make sure Status never gets included from common for contained projects
srcs = [ f for f in srcs if basename(str(f)) not in status_src ]

static_objs = commonenv.Object(srcs)

if commonenv['LIBTYPE'] != 'static':
    shared_objs = commonenv.SharedObject(srcs)
else:
    shared_objs = []


libcommon = commonenv.StaticLibrary('$OBJDIR_COMMON/common_static', [static_objs, status_obj])

# Build unit Tests
commonenv.SConscript('unit_test/SConscript', variant_dir='$OBJDIR_COMMON/unittest', duplicate=0, exports=['commonenv', 'libcommon'])

ret = (hdrs, static_objs, shared_objs)

Return('ret')