Sha256: 5c5c334f7e6cc1ce5cf389da344f1a46fdd4ed6000fb1cc8900070ad704b4e8d

Contents?: true

Size: 1.63 KB

Versions: 23

Compression:

Stored size: 1.63 KB

Contents

#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that the user can override the compiler and linker using CC/CXX/LD
environment variables.
"""

import TestGyp
import os
import copy
import sys

here = os.path.dirname(os.path.abspath(__file__))

if sys.platform == 'win32':
  # cross compiling not support by ninja on windows
  # and make not supported on windows at all.
  sys.exit(0)

test = TestGyp.TestGyp(formats=['ninja', 'make'])

def CheckCompiler(test, gypfile, check_for):
  test.run_gyp(gypfile)
  test.build(gypfile)

  # We can't test to presence of my_ld.py in the output since
  # ninja will use CXX_target as the linker regardless
  test.must_contain_all_lines(test.stdout(), check_for)

oldenv = os.environ.copy()
try:
  # Check that CC, CXX and LD set target compiler
  os.environ['CC'] = 'python %s/my_cc.py FOO' % here
  os.environ['CXX'] = 'python %s/my_cxx.py FOO' % here
  os.environ['LD'] = 'python %s/my_ld.py FOO_LINK' % here
  CheckCompiler(test, 'compiler.gyp',
                ['my_cc.py', 'my_cxx.py', 'FOO', 'FOO_LINK'])
finally:
  os.environ.clear()
  os.environ.update(oldenv)

try:
  # Check that CC_host sets host compilee
  os.environ['CC_host'] = 'python %s/my_cc.py HOST' % here
  os.environ['CXX_host'] = 'python %s/my_cxx.py HOST' % here
  os.environ['LD_host'] = 'python %s/my_ld.py HOST_LINK' % here
  CheckCompiler(test, 'compiler-host.gyp',
                ['my_cc.py', 'my_cxx.py', 'HOST', 'HOST_LINK'])
finally:
  os.environ.clear()
  os.environ.update(oldenv)

test.pass_test()

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
libv8-3.16.14.19.1 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.19 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.18 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
arcabouco-0.2.13 vendor/bundle/gems/libv8-3.16.14.17/vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.17 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.16 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.15 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.14 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-tmpfork-3.16.14.13 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.13 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.12 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.11 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.10 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.8 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.8.rc1 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.7 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.6 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.5 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.4 vendor/gyp/test/compiler-override/gyptest-compiler-env.py
libv8-3.16.14.3 vendor/gyp/test/compiler-override/gyptest-compiler-env.py