# Copyright 2008 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
#       copyright notice, this list of conditions and the following
#       disclaimer in the documentation and/or other materials provided
#       with the distribution.
#     * Neither the name of Google Inc. nor the names of its
#       contributors may be used to endorse or promote products derived
#       from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import sys
from os.path import join, dirname, abspath
root_dir = dirname(File('SConstruct').rfile().abspath)
sys.path.append(join(root_dir, 'tools'))
Import('context object_files')


SOURCES = {
  'all': [
    'gay-fixed.cc',
    'gay-shortest.cc',
    'test-accessors.cc',
    'test-alloc.cc',
    'test-api.cc',
    'test-ast.cc',
    'test-circular-queue.cc',
    'test-compiler.cc',
    'test-conversions.cc',
    'test-cpu-profiler.cc',
    'test-dataflow.cc',
    'test-debug.cc',
    'test-decls.cc',
    'test-diy-fp.cc',
    'test-double.cc',
    'test-fast-dtoa.cc',
    'test-fixed-dtoa.cc',
    'test-flags.cc',
    'test-func-name-inference.cc',
    'test-hashmap.cc',
    'test-heap.cc',
    'test-heap-profiler.cc',
    'test-list.cc',
    'test-liveedit.cc',
    'test-lock.cc',
    'test-log.cc',
    'test-log-utils.cc',
    'test-mark-compact.cc',
    'test-parsing.cc',
    'test-profile-generator.cc',
    'test-regexp.cc',
    'test-serialize.cc',
    'test-sockets.cc',
    'test-spaces.cc',
    'test-strings.cc',
    'test-thread-termination.cc',
    'test-threads.cc',
    'test-type-info.cc',
    'test-unbound-queue.cc',
    'test-utils.cc',
    'test-version.cc'
  ],
  'arch:arm':  [
    'test-assembler-arm.cc',
    'test-disasm-arm.cc'
  ],
  'arch:ia32': [
    'test-assembler-ia32.cc',
    'test-disasm-ia32.cc',
    'test-log-stack-tracer.cc'
  ],
  'arch:x64': ['test-assembler-x64.cc',
               'test-macro-assembler-x64.cc',
               'test-log-stack-tracer.cc'],
  'arch:mips': ['test-assembler-mips.cc', 'test-mips.cc'],
  'os:linux':  ['test-platform-linux.cc'],
  'os:macos':  ['test-platform-macos.cc'],
  'os:nullos': ['test-platform-nullos.cc'],
  'os:win32':  ['test-platform-win32.cc']
}


def Build():
  cctest_files = context.GetRelevantSources(SOURCES)
  env = Environment()
  env.Replace(**context.flags['cctest'])
  context.ApplyEnvOverrides(env)
  # There seems to be a glitch in the way scons decides where to put
  # PDB files when compiling using MSVC so we specify it manually.
  # This should not affect any other platforms.
  return env.Program('cctest', ['cctest.cc', cctest_files, object_files],
      PDB='cctest.exe.pdb')


program = Build()
Return('program')
