ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1 | # Copyright 2008 the V8 project authors. All rights reserved. |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 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 | |
| 28 | import sys |
| 29 | from os.path import join, dirname, abspath |
| 30 | root_dir = dirname(File('SConstruct').rfile().abspath) |
| 31 | sys.path.append(join(root_dir, 'tools')) |
| 32 | Import('context object_files') |
| 33 | |
| 34 | |
| 35 | SOURCES = { |
| 36 | 'all': [ |
sgjesse@chromium.org | 720dc0b | 2010-05-10 09:25:39 +0000 | [diff] [blame^] | 37 | 'gay-fixed.cc', |
whesse@chromium.org | cec079d | 2010-03-22 14:44:04 +0000 | [diff] [blame] | 38 | 'gay-shortest.cc', |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 39 | 'test-accessors.cc', |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 40 | 'test-alloc.cc', |
| 41 | 'test-api.cc', |
| 42 | 'test-ast.cc', |
whesse@chromium.org | cec079d | 2010-03-22 14:44:04 +0000 | [diff] [blame] | 43 | 'test-circular-queue.cc', |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 44 | 'test-compiler.cc', |
| 45 | 'test-conversions.cc', |
whesse@chromium.org | cec079d | 2010-03-22 14:44:04 +0000 | [diff] [blame] | 46 | 'test-cpu-profiler.cc', |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 47 | 'test-dataflow.cc', |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 48 | 'test-debug.cc', |
| 49 | 'test-decls.cc', |
whesse@chromium.org | cec079d | 2010-03-22 14:44:04 +0000 | [diff] [blame] | 50 | 'test-diy-fp.cc', |
| 51 | 'test-double.cc', |
| 52 | 'test-fast-dtoa.cc', |
sgjesse@chromium.org | 720dc0b | 2010-05-10 09:25:39 +0000 | [diff] [blame^] | 53 | 'test-fixed-dtoa.cc', |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 54 | 'test-flags.cc', |
kasperl@chromium.org | d1e3e72 | 2009-04-14 13:38:25 +0000 | [diff] [blame] | 55 | 'test-func-name-inference.cc', |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 56 | 'test-hashmap.cc', |
| 57 | 'test-heap.cc', |
christian.plesner.hansen@gmail.com | 2bc58ef | 2009-09-22 10:00:30 +0000 | [diff] [blame] | 58 | 'test-heap-profiler.cc', |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 59 | 'test-list.cc', |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 60 | 'test-liveedit.cc', |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 61 | 'test-lock.cc', |
ager@chromium.org | 9085a01 | 2009-05-11 19:22:57 +0000 | [diff] [blame] | 62 | 'test-log.cc', |
sgjesse@chromium.org | 755c5b1 | 2009-05-29 11:04:38 +0000 | [diff] [blame] | 63 | 'test-log-utils.cc', |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 64 | 'test-mark-compact.cc', |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 65 | 'test-parsing.cc', |
fschneider@chromium.org | 086aac6 | 2010-03-17 13:18:24 +0000 | [diff] [blame] | 66 | 'test-profile-generator.cc', |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 67 | '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.org | c81c894 | 2009-08-21 10:54:26 +0000 | [diff] [blame] | 73 | 'test-thread-termination.cc', |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 74 | 'test-utils.cc', |
| 75 | 'test-version.cc' |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 76 | ], |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 77 | 'arch:arm': [ |
| 78 | 'test-assembler-arm.cc', |
| 79 | 'test-disasm-arm.cc' |
| 80 | ], |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 81 | 'arch:ia32': [ |
| 82 | 'test-assembler-ia32.cc', |
| 83 | 'test-disasm-ia32.cc', |
sgjesse@chromium.org | b9d7da1 | 2009-08-05 08:38:10 +0000 | [diff] [blame] | 84 | 'test-log-stack-tracer.cc' |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 85 | ], |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 86 | 'arch:x64': ['test-assembler-x64.cc', |
| 87 | 'test-macro-assembler-x64.cc', |
| 88 | 'test-log-stack-tracer.cc'], |
kmillikin@chromium.org | 5d8f0e6 | 2010-03-24 08:21:20 +0000 | [diff] [blame] | 89 | 'arch:mips': ['test-assembler-mips.cc', 'test-mips.cc'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 90 | '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 | |
| 97 | def Build(): |
| 98 | cctest_files = context.GetRelevantSources(SOURCES) |
| 99 | env = Environment() |
| 100 | env.Replace(**context.flags['cctest']) |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 101 | context.ApplyEnvOverrides(env) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 102 | # 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 | |
| 109 | program = Build() |
| 110 | Return('program') |