blob: 2cf0b128ad104cbd4fd7bfcfd71375d8fc8b3ea4 [file] [log] [blame]
ager@chromium.org9258b6b2008-09-11 09:11:10 +00001# Copyright 2008 the V8 project authors. All rights reserved.
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +00002# 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': [
sgjesse@chromium.org720dc0b2010-05-10 09:25:39 +000037 'gay-fixed.cc',
whesse@chromium.orgcec079d2010-03-22 14:44:04 +000038 'gay-shortest.cc',
ager@chromium.orgc4c92722009-11-18 14:12:51 +000039 'test-accessors.cc',
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000040 'test-alloc.cc',
41 'test-api.cc',
42 'test-ast.cc',
whesse@chromium.orgcec079d2010-03-22 14:44:04 +000043 'test-circular-queue.cc',
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000044 'test-compiler.cc',
45 'test-conversions.cc',
whesse@chromium.orgcec079d2010-03-22 14:44:04 +000046 'test-cpu-profiler.cc',
ager@chromium.orgce5e87b2010-03-10 10:24:18 +000047 'test-dataflow.cc',
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000048 'test-debug.cc',
49 'test-decls.cc',
whesse@chromium.orgcec079d2010-03-22 14:44:04 +000050 'test-diy-fp.cc',
51 'test-double.cc',
52 'test-fast-dtoa.cc',
sgjesse@chromium.org720dc0b2010-05-10 09:25:39 +000053 'test-fixed-dtoa.cc',
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000054 'test-flags.cc',
kasperl@chromium.orgd1e3e722009-04-14 13:38:25 +000055 'test-func-name-inference.cc',
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000056 'test-hashmap.cc',
57 'test-heap.cc',
christian.plesner.hansen@gmail.com2bc58ef2009-09-22 10:00:30 +000058 'test-heap-profiler.cc',
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000059 'test-list.cc',
ricow@chromium.orgc9c80822010-04-21 08:22:37 +000060 'test-liveedit.cc',
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000061 'test-lock.cc',
ager@chromium.org9085a012009-05-11 19:22:57 +000062 'test-log.cc',
sgjesse@chromium.org755c5b12009-05-29 11:04:38 +000063 'test-log-utils.cc',
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000064 'test-mark-compact.cc',
ager@chromium.orgc4c92722009-11-18 14:12:51 +000065 'test-parsing.cc',
fschneider@chromium.org086aac62010-03-17 13:18:24 +000066 'test-profile-generator.cc',
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000067 'test-regexp.cc',
68 'test-serialize.cc',
69 'test-sockets.cc',
70 'test-spaces.cc',
71 'test-strings.cc',
72 'test-threads.cc',
sgjesse@chromium.orgc81c8942009-08-21 10:54:26 +000073 'test-thread-termination.cc',
ager@chromium.org5ec48922009-05-05 07:25:34 +000074 'test-utils.cc',
75 'test-version.cc'
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000076 ],
ager@chromium.org5c838252010-02-19 08:53:10 +000077 'arch:arm': [
78 'test-assembler-arm.cc',
79 'test-disasm-arm.cc'
80 ],
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000081 'arch:ia32': [
82 'test-assembler-ia32.cc',
83 'test-disasm-ia32.cc',
sgjesse@chromium.orgb9d7da12009-08-05 08:38:10 +000084 'test-log-stack-tracer.cc'
kasperl@chromium.org7be3c992009-03-12 07:19:55 +000085 ],
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +000086 'arch:x64': ['test-assembler-x64.cc',
87 'test-macro-assembler-x64.cc',
88 'test-log-stack-tracer.cc'],
kmillikin@chromium.org5d8f0e62010-03-24 08:21:20 +000089 'arch:mips': ['test-assembler-mips.cc', 'test-mips.cc'],
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000090 'os:linux': ['test-platform-linux.cc'],
91 'os:macos': ['test-platform-macos.cc'],
92 'os:nullos': ['test-platform-nullos.cc'],
93 'os:win32': ['test-platform-win32.cc']
94}
95
96
97def Build():
98 cctest_files = context.GetRelevantSources(SOURCES)
99 env = Environment()
100 env.Replace(**context.flags['cctest'])
ager@chromium.org9258b6b2008-09-11 09:11:10 +0000101 context.ApplyEnvOverrides(env)
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000102 # There seems to be a glitch in the way scons decides where to put
103 # PDB files when compiling using MSVC so we specify it manually.
104 # This should not affect any other platforms.
105 return env.Program('cctest', ['cctest.cc', cctest_files, object_files],
106 PDB='cctest.exe.pdb')
107
108
109program = Build()
110Return('program')