blob: f4cb4a9a60b3d7df0d907406f86f5261c27d5cd2 [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': [
Kristian Monsen25f61362010-05-21 11:50:48 +010037 'gay-fixed.cc',
Kristian Monsen0d5e1162010-09-30 15:31:59 +010038 'gay-precision.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010039 'gay-shortest.cc',
Steve Blockd0582a62009-12-15 09:54:21 +000040 'test-accessors.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000041 'test-alloc.cc',
42 'test-api.cc',
43 'test-ast.cc',
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -080044 'test-bignum-dtoa.cc',
Steve Block44f0eee2011-05-26 01:26:41 +010045 'test-bignum.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010046 'test-circular-queue.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000047 'test-compiler.cc',
48 'test-conversions.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010049 'test-cpu-profiler.cc',
50 'test-dataflow.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000051 'test-debug.cc',
52 'test-decls.cc',
Ben Murdochb0fe1622011-05-05 13:52:32 +010053 'test-deoptimization.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010054 'test-diy-fp.cc',
55 'test-double.cc',
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -080056 'test-dtoa.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010057 'test-fast-dtoa.cc',
Kristian Monsen25f61362010-05-21 11:50:48 +010058 'test-fixed-dtoa.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000059 'test-flags.cc',
60 'test-func-name-inference.cc',
61 'test-hashmap.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000062 'test-heap-profiler.cc',
Steve Block44f0eee2011-05-26 01:26:41 +010063 'test-heap.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000064 'test-list.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010065 'test-liveedit.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000066 'test-lock.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000067 'test-log-utils.cc',
Steve Block44f0eee2011-05-26 01:26:41 +010068 'test-log.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000069 'test-mark-compact.cc',
Steve Blockd0582a62009-12-15 09:54:21 +000070 'test-parsing.cc',
Steve Block44f0eee2011-05-26 01:26:41 +010071 'test-platform-tls.cc',
Steve Block6ded16b2010-05-10 14:33:55 +010072 'test-profile-generator.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000073 'test-regexp.cc',
Ben Murdochb0fe1622011-05-05 13:52:32 +010074 'test-reloc-info.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000075 'test-serialize.cc',
76 'test-sockets.cc',
77 'test-spaces.cc',
78 'test-strings.cc',
Ben Murdochf87a2032010-10-22 12:50:53 +010079 'test-strtod.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000080 'test-thread-termination.cc',
Steve Block8defd9f2010-07-08 12:39:36 +010081 'test-threads.cc',
82 'test-type-info.cc',
Leon Clarkef7060e22010-06-03 12:02:55 +010083 'test-unbound-queue.cc',
Steve Blocka7e24c12009-10-30 11:49:00 +000084 'test-utils.cc',
85 'test-version.cc'
86 ],
Andrei Popescu31002712010-02-23 13:46:05 +000087 'arch:arm': [
88 'test-assembler-arm.cc',
89 'test-disasm-arm.cc'
90 ],
Steve Blocka7e24c12009-10-30 11:49:00 +000091 'arch:ia32': [
92 'test-assembler-ia32.cc',
93 'test-disasm-ia32.cc',
94 'test-log-stack-tracer.cc'
95 ],
Steve Block3ce2e202009-11-05 08:53:23 +000096 'arch:x64': ['test-assembler-x64.cc',
97 'test-macro-assembler-x64.cc',
98 'test-log-stack-tracer.cc'],
Steve Block44f0eee2011-05-26 01:26:41 +010099 'arch:mips': ['test-assembler-mips.cc'],
Steve Blocka7e24c12009-10-30 11:49:00 +0000100 'os:linux': ['test-platform-linux.cc'],
101 'os:macos': ['test-platform-macos.cc'],
102 'os:nullos': ['test-platform-nullos.cc'],
103 'os:win32': ['test-platform-win32.cc']
104}
105
106
107def Build():
108 cctest_files = context.GetRelevantSources(SOURCES)
109 env = Environment()
110 env.Replace(**context.flags['cctest'])
111 context.ApplyEnvOverrides(env)
112 # There seems to be a glitch in the way scons decides where to put
113 # PDB files when compiling using MSVC so we specify it manually.
114 # This should not affect any other platforms.
115 return env.Program('cctest', ['cctest.cc', cctest_files, object_files],
116 PDB='cctest.exe.pdb')
117
118
119program = Build()
120Return('program')