Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame^] | 1 | # Copyright (c) 2009 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 | 'target_defaults': { |
| 7 | 'target_conditions': [ |
| 8 | ['_toolset=="target"', {'defines': ['TARGET']}] |
| 9 | ] |
| 10 | }, |
| 11 | 'targets': [ |
| 12 | { |
| 13 | 'target_name': 'toolsets', |
| 14 | 'type': 'static_library', |
| 15 | 'toolsets': ['target', 'host'], |
| 16 | 'sources': [ |
| 17 | 'toolsets.cc', |
| 18 | ], |
| 19 | }, |
| 20 | { |
| 21 | 'target_name': 'host-main', |
| 22 | 'type': 'executable', |
| 23 | 'toolsets': ['host'], |
| 24 | 'dependencies': ['toolsets', 'toolsets_shared'], |
| 25 | 'sources': [ |
| 26 | 'main.cc', |
| 27 | ], |
| 28 | }, |
| 29 | { |
| 30 | 'target_name': 'target-main', |
| 31 | 'type': 'executable', |
| 32 | 'dependencies': ['toolsets', 'toolsets_shared'], |
| 33 | 'sources': [ |
| 34 | 'main.cc', |
| 35 | ], |
| 36 | }, |
| 37 | # This tests that build systems can handle a shared library being build for |
| 38 | # both host and target. |
| 39 | { |
| 40 | 'target_name': 'janus', |
| 41 | 'type': 'shared_library', |
| 42 | 'toolsets': ['target', 'host'], |
| 43 | 'sources': [ |
| 44 | 'toolsets.cc', |
| 45 | ], |
| 46 | 'cflags': [ '-fPIC' ], |
| 47 | }, |
| 48 | { |
| 49 | 'target_name': 'toolsets_shared', |
| 50 | 'type': 'shared_library', |
| 51 | 'toolsets': ['target', 'host'], |
| 52 | 'target_conditions': [ |
| 53 | # Ensure target and host have different shared_library names |
| 54 | ['_toolset=="host"', {'product_extension': 'host'}], |
| 55 | ], |
| 56 | 'sources': [ |
| 57 | 'toolsets_shared.cc', |
| 58 | ], |
| 59 | 'cflags': [ '-fPIC' ], |
| 60 | }, |
| 61 | ], |
| 62 | } |