blob: 5eab892f092c5eab7b3bfcc9bbe32a6209f56e72 [file] [log] [blame]
Steve Blocka7e24c12009-10-30 11:49:00 +00001# Copyright 2008 the V8 project authors. All rights reserved.
2# Redistribution and use in source and binary forms, with or without
3# modification, are permitted provided that the following conditions are
4# met:
5#
6# * Redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer.
8# * Redistributions in binary form must reproduce the above
9# copyright notice, this list of conditions and the following
10# disclaimer in the documentation and/or other materials provided
11# with the distribution.
12# * Neither the name of Google Inc. nor the names of its
13# contributors may be used to endorse or promote products derived
14# from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28import sys
29from os.path import join, dirname, abspath
30root_dir = dirname(File('SConstruct').rfile().abspath)
31sys.path.append(join(root_dir, 'tools'))
32Import('context object_files')
33
34
35SOURCES = {
36 'all': [
Steve Block6ded16b2010-05-10 14:33:55 +010037 'gay-shortest.cc',
Steve Blockd0582a62009-12-15 09:54:21 +000038 'test-accessors.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000039 'test-alloc.cc',
40 'test-api.cc',
41 'test-ast.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010042 'test-circular-queue.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000043 'test-compiler.cc',
44 'test-conversions.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010045 'test-cpu-profiler.cc',
46 'test-dataflow.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000047 'test-debug.cc',
48 'test-decls.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010049 'test-diy-fp.cc',
50 'test-double.cc',
51 'test-fast-dtoa.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000052 'test-flags.cc',
53 'test-func-name-inference.cc',
54 'test-hashmap.cc',
55 'test-heap.cc',
56 'test-heap-profiler.cc',
57 'test-list.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010058 'test-liveedit.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000059 'test-lock.cc',
60 'test-log.cc',
61 'test-log-utils.cc',
62 'test-mark-compact.cc',
Steve Blockd0582a62009-12-15 09:54:21 +000063 'test-parsing.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010064 'test-profile-generator.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000065 'test-regexp.cc',
66 'test-serialize.cc',
67 'test-sockets.cc',
68 'test-spaces.cc',
69 'test-strings.cc',
70 'test-threads.cc',
71 'test-thread-termination.cc',
72 'test-utils.cc',
73 'test-version.cc'
74 ],
Andrei Popescu31002712010-02-23 13:46:05 +000075 'arch:arm': [
76 'test-assembler-arm.cc',
77 'test-disasm-arm.cc'
78 ],
Steve Blocka7e24c12009-10-30 11:49:00 +000079 'arch:ia32': [
80 'test-assembler-ia32.cc',
81 'test-disasm-ia32.cc',
82 'test-log-stack-tracer.cc'
83 ],
Steve Block3ce2e202009-11-05 08:53:23 +000084 'arch:x64': ['test-assembler-x64.cc',
85 'test-macro-assembler-x64.cc',
86 'test-log-stack-tracer.cc'],
Steve Block6ded16b2010-05-10 14:33:55 +010087 'arch:mips': ['test-assembler-mips.cc', 'test-mips.cc'],
Steve Blocka7e24c12009-10-30 11:49:00 +000088 'os:linux': ['test-platform-linux.cc'],
89 'os:macos': ['test-platform-macos.cc'],
90 'os:nullos': ['test-platform-nullos.cc'],
91 'os:win32': ['test-platform-win32.cc']
92}
93
94
95def Build():
96 cctest_files = context.GetRelevantSources(SOURCES)
97 env = Environment()
98 env.Replace(**context.flags['cctest'])
99 context.ApplyEnvOverrides(env)
100 # There seems to be a glitch in the way scons decides where to put
101 # PDB files when compiling using MSVC so we specify it manually.
102 # This should not affect any other platforms.
103 return env.Program('cctest', ['cctest.cc', cctest_files, object_files],
104 PDB='cctest.exe.pdb')
105
106
107program = Build()
108Return('program')