Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | # Copyright (c) 2012 Google Inc. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | """ |
| 8 | Verifies that filenames passed to various linker flags are converted into |
| 9 | build-directory relative paths correctly. |
| 10 | """ |
| 11 | |
| 12 | import TestGyp |
| 13 | |
| 14 | import sys |
| 15 | |
| 16 | if sys.platform == 'darwin': |
| 17 | test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) |
| 18 | |
| 19 | # The xcode-ninja generator handles gypfiles which are not at the |
| 20 | # project root incorrectly. |
| 21 | # cf. https://code.google.com/p/gyp/issues/detail?id=460 |
| 22 | if test.format == 'xcode-ninja': |
| 23 | test.skip_test() |
| 24 | |
| 25 | CHDIR = 'ldflags' |
| 26 | test.run_gyp('subdirectory/test.gyp', chdir=CHDIR) |
| 27 | |
| 28 | test.build('subdirectory/test.gyp', test.ALL, chdir=CHDIR) |
| 29 | |
| 30 | test.pass_test() |
| 31 | |
| 32 | |
| 33 | # These flags from `man ld` couldl show up in OTHER_LDFLAGS and need path |
| 34 | # translation. |
| 35 | # |
| 36 | # Done: |
| 37 | # -exported_symbols_list filename |
| 38 | # -unexported_symbols_list file |
| 39 | # -reexported_symbols_list file |
| 40 | # -sectcreate segname sectname file |
| 41 | # |
| 42 | # Will be done on demand: |
| 43 | # -weak_library path_to_library |
| 44 | # -reexport_library path_to_library |
| 45 | # -lazy_library path_to_library |
| 46 | # -upward_library path_to_library |
| 47 | # -syslibroot rootdir |
| 48 | # -framework name[,suffix] |
| 49 | # -weak_framework name[,suffix] |
| 50 | # -reexport_framework name[,suffix] |
| 51 | # -lazy_framework name[,suffix] |
| 52 | # -upward_framework name[,suffix] |
| 53 | # -force_load path_to_archive |
| 54 | # -filelist file[,dirname] |
| 55 | # -dtrace file |
| 56 | # -order_file file # should use ORDER_FILE |
| 57 | # -exported_symbols_order file |
| 58 | # -bundle_loader executable # should use BUNDLE_LOADER |
| 59 | # -alias_list filename |
| 60 | # -seg_addr_table filename |
| 61 | # -dylib_file install_name:file_name |
| 62 | # -interposable_list filename |
| 63 | # -object_path_lto filename |
| 64 | # |
| 65 | # |
| 66 | # obsolete: |
| 67 | # -sectorder segname sectname orderfile |
| 68 | # -seg_addr_table_filename path |
| 69 | # |
| 70 | # |
| 71 | # ??: |
| 72 | # -map map_file_path |
| 73 | # -sub_library library_name |
| 74 | # -sub_umbrella framework_name |