| 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', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 38 | 'gay-shortest.cc', |
| Steve Block | d0582a6 | 2009-12-15 09:54:21 +0000 | [diff] [blame] | 39 | 'test-accessors.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 40 | 'test-alloc.cc', |
| 41 | 'test-api.cc', |
| 42 | 'test-ast.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 43 | 'test-circular-queue.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 44 | 'test-compiler.cc', |
| 45 | 'test-conversions.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 46 | 'test-cpu-profiler.cc', |
| 47 | 'test-dataflow.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 48 | 'test-debug.cc', |
| 49 | 'test-decls.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 50 | 'test-diy-fp.cc', |
| 51 | 'test-double.cc', |
| 52 | 'test-fast-dtoa.cc', |
| Kristian Monsen | 25f6136 | 2010-05-21 11:50:48 +0100 | [diff] [blame] | 53 | 'test-fixed-dtoa.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 54 | 'test-flags.cc', |
| 55 | 'test-func-name-inference.cc', |
| 56 | 'test-hashmap.cc', |
| 57 | 'test-heap.cc', |
| 58 | 'test-heap-profiler.cc', |
| 59 | 'test-list.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 60 | 'test-liveedit.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 61 | 'test-lock.cc', |
| 62 | 'test-log.cc', |
| 63 | 'test-log-utils.cc', |
| 64 | 'test-mark-compact.cc', |
| Steve Block | d0582a6 | 2009-12-15 09:54:21 +0000 | [diff] [blame] | 65 | 'test-parsing.cc', |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 66 | 'test-profile-generator.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +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', |
| 73 | 'test-thread-termination.cc', |
| Leon Clarke | f7060e2 | 2010-06-03 12:02:55 +0100 | [diff] [blame^] | 74 | 'test-unbound-queue.cc', |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 75 | 'test-utils.cc', |
| 76 | 'test-version.cc' |
| 77 | ], |
| Andrei Popescu | 3100271 | 2010-02-23 13:46:05 +0000 | [diff] [blame] | 78 | 'arch:arm': [ |
| 79 | 'test-assembler-arm.cc', |
| 80 | 'test-disasm-arm.cc' |
| 81 | ], |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 82 | 'arch:ia32': [ |
| 83 | 'test-assembler-ia32.cc', |
| 84 | 'test-disasm-ia32.cc', |
| 85 | 'test-log-stack-tracer.cc' |
| 86 | ], |
| Steve Block | 3ce2e20 | 2009-11-05 08:53:23 +0000 | [diff] [blame] | 87 | 'arch:x64': ['test-assembler-x64.cc', |
| 88 | 'test-macro-assembler-x64.cc', |
| 89 | 'test-log-stack-tracer.cc'], |
| Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 90 | 'arch:mips': ['test-assembler-mips.cc', 'test-mips.cc'], |
| Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 91 | 'os:linux': ['test-platform-linux.cc'], |
| 92 | 'os:macos': ['test-platform-macos.cc'], |
| 93 | 'os:nullos': ['test-platform-nullos.cc'], |
| 94 | 'os:win32': ['test-platform-win32.cc'] |
| 95 | } |
| 96 | |
| 97 | |
| 98 | def Build(): |
| 99 | cctest_files = context.GetRelevantSources(SOURCES) |
| 100 | env = Environment() |
| 101 | env.Replace(**context.flags['cctest']) |
| 102 | context.ApplyEnvOverrides(env) |
| 103 | # There seems to be a glitch in the way scons decides where to put |
| 104 | # PDB files when compiling using MSVC so we specify it manually. |
| 105 | # This should not affect any other platforms. |
| 106 | return env.Program('cctest', ['cctest.cc', cctest_files, object_files], |
| 107 | PDB='cctest.exe.pdb') |
| 108 | |
| 109 | |
| 110 | program = Build() |
| 111 | Return('program') |