| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 1 | # 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 | |
| 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': [ |
| Kristian Monsen | 25f6136 | 2010-05-21 11:50:48 +0100 | [diff] [blame] | 37 | 'gay-fixed.cc', |
| Kristian Monsen | 0d5e116 | 2010-09-30 15:31:59 +0100 | [diff] [blame] | 38 | 'gay-precision.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 39 | 'gay-shortest.cc', |
| Steve Block | d0582a6 | 2009-12-15 09:54:21 +0000 | [diff] [blame] | 40 | 'test-accessors.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 41 | 'test-alloc.cc', |
| 42 | 'test-api.cc', |
| 43 | 'test-ast.cc', |
| Shimeng (Simon) Wang | 8a31eba | 2010-12-06 19:01:33 -0800 | [diff] [blame] | 44 | 'test-bignum-dtoa.cc', |
| Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame] | 45 | 'test-bignum.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 46 | 'test-circular-queue.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 47 | 'test-compiler.cc', |
| 48 | 'test-conversions.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 49 | 'test-cpu-profiler.cc', |
| 50 | 'test-dataflow.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 51 | 'test-debug.cc', |
| 52 | 'test-decls.cc', |
| Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 53 | 'test-deoptimization.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 54 | 'test-diy-fp.cc', |
| 55 | 'test-double.cc', |
| Shimeng (Simon) Wang | 8a31eba | 2010-12-06 19:01:33 -0800 | [diff] [blame] | 56 | 'test-dtoa.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 57 | 'test-fast-dtoa.cc', |
| Kristian Monsen | 25f6136 | 2010-05-21 11:50:48 +0100 | [diff] [blame] | 58 | 'test-fixed-dtoa.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 59 | 'test-flags.cc', |
| 60 | 'test-func-name-inference.cc', |
| 61 | 'test-hashmap.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 62 | 'test-heap-profiler.cc', |
| Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame] | 63 | 'test-heap.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 64 | 'test-list.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 65 | 'test-liveedit.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 66 | 'test-lock.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 67 | 'test-log-utils.cc', |
| Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame] | 68 | 'test-log.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 69 | 'test-mark-compact.cc', |
| Steve Block | d0582a6 | 2009-12-15 09:54:21 +0000 | [diff] [blame] | 70 | 'test-parsing.cc', |
| Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame] | 71 | 'test-platform-tls.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 72 | 'test-profile-generator.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 73 | 'test-regexp.cc', |
| Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 74 | 'test-reloc-info.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 75 | 'test-serialize.cc', |
| 76 | 'test-sockets.cc', |
| 77 | 'test-spaces.cc', |
| 78 | 'test-strings.cc', |
| Ben Murdoch | f87a203 | 2010-10-22 12:50:53 +0100 | [diff] [blame] | 79 | 'test-strtod.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 80 | 'test-thread-termination.cc', |
| Steve Block | 8defd9f | 2010-07-08 12:39:36 +0100 | [diff] [blame] | 81 | 'test-threads.cc', |
| 82 | 'test-type-info.cc', |
| Leon Clarke | f7060e2 | 2010-06-03 12:02:55 +0100 | [diff] [blame] | 83 | 'test-unbound-queue.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 84 | 'test-utils.cc', |
| 85 | 'test-version.cc' |
| 86 | ], |
| Andrei Popescu | 3100271 | 2010-02-23 13:46:05 +0000 | [diff] [blame] | 87 | 'arch:arm': [ |
| 88 | 'test-assembler-arm.cc', |
| 89 | 'test-disasm-arm.cc' |
| 90 | ], |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 91 | 'arch:ia32': [ |
| 92 | 'test-assembler-ia32.cc', |
| 93 | 'test-disasm-ia32.cc', |
| 94 | 'test-log-stack-tracer.cc' |
| 95 | ], |
| Steve Block | 3ce2e20 | 2009-11-05 08:53:23 +0000 | [diff] [blame] | 96 | 'arch:x64': ['test-assembler-x64.cc', |
| 97 | 'test-macro-assembler-x64.cc', |
| 98 | 'test-log-stack-tracer.cc'], |
| Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame] | 99 | 'arch:mips': ['test-assembler-mips.cc'], |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 100 | '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 | |
| 107 | def 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 | |
| 119 | program = Build() |
| 120 | Return('program') |