gyptest-link-target-machine.py 860 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python
  2. # Copyright (c) 2013 Google Inc. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """
  6. Make sure TargetMachine setting is extracted properly.
  7. """
  8. import TestGyp
  9. import sys
  10. if sys.platform == 'win32':
  11. test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
  12. CHDIR = 'linker-flags'
  13. test.run_gyp('target-machine.gyp', chdir=CHDIR)
  14. # The .cc file is compiled as x86 (the default), so the link/libs that are
  15. # x64 need to fail.
  16. test.build('target-machine.gyp', 'test_target_link_x86', chdir=CHDIR)
  17. test.build(
  18. 'target-machine.gyp', 'test_target_link_x64', chdir=CHDIR, status=1)
  19. test.build('target-machine.gyp', 'test_target_lib_x86', chdir=CHDIR)
  20. test.build('target-machine.gyp', 'test_target_lib_x64', chdir=CHDIR, status=1)
  21. test.pass_test()