Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright (c) 2012 Google Inc. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 { | |
| 6 'targets': [ | |
| 7 { | |
| 8 # This creates a static library and puts it in a nonstandard location for | |
| 9 # libraries-search-path-test. | |
| 10 'target_name': 'mylib', | |
| 11 'type': 'static_library', | |
| 12 'standalone_static_library': 1, | |
| 13 # This directory is NOT in the default library search locations. It also | |
| 14 # MUST be passed in on the gyp command line: | |
| 15 # | |
| 16 # -D abs_path_to_secret_library_location=/some_absolute_path | |
| 17 # | |
| 18 # The gyptest itself (../gyptest-library-dirs.py) provides this. | |
| 19 'product_dir': '<(abs_path_to_secret_library_location)', | |
| 20 'sources': [ | |
| 21 'mylib.cc', | |
| 22 ], | |
| 23 }, | |
| 24 { | |
| 25 'target_name': 'libraries-search-path-test', | |
| 26 'type': 'executable', | |
| 27 'dependencies': [ | |
| 28 # It is important to NOT list the mylib as a dependency here, because | |
|
Mark Mentovai
2013/05/29 13:23:07
I don’t see how any build system would ensure that
Dimi Shahbaz
2013/05/29 21:32:41
That's the point of the weird structuring of this
| |
| 29 # some build systems will track it down based on its product_dir, | |
| 30 # such that the link succeeds even without the library_dirs below. | |
| 31 #'mylib', | |
| 32 ], | |
| 33 'sources': [ | |
| 34 'hello.cc', | |
| 35 ], | |
| 36 # Note that without this, the mylib library would not be found and | |
| 37 # successfully linked. | |
| 38 'library_dirs': [ | |
| 39 '<(abs_path_to_secret_library_location)', | |
| 40 ], | |
| 41 'link_settings': { | |
| 42 'conditions': [ | |
| 43 ['OS=="linux"', { | |
| 44 'libraries': [ | |
| 45 '-lmylib', | |
| 46 ], | |
| 47 }, { # else | |
| 48 'libraries': [ | |
| 49 '<(STATIC_LIB_PREFIX)mylib<(STATIC_LIB_SUFFIX)', | |
| 50 ], | |
| 51 }], | |
| 52 ], # conditions | |
| 53 }, | |
| 54 }, | |
| 55 ], | |
| 56 } | |
| OLD | NEW |