OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("../public/mojo_sdk.gni") | 5 import("../public/mojo_sdk.gni") |
6 | 6 |
7 # A mojo_edk_source_set is a mojo_sdk_source_set that does not restrict | 7 # A mojo_edk_source_set is a mojo_sdk_source_set that does not restrict |
8 # external dependencies and understands the following additional variables, all | 8 # external dependencies and understands the following additional variables, all |
9 # of which admit a list of the relevant elements specified relative to the | 9 # of which admit a list of the relevant elements specified relative to the |
10 # location of the Mojo EDK: | 10 # location of the Mojo EDK: |
11 # mojo_edk_configs | 11 # mojo_edk_configs |
12 # allow_circular_mojo_edk_includes_from | 12 # allow_circular_mojo_edk_includes_from |
13 # mojo_edk_public_deps | 13 # mojo_edk_public_deps |
14 # mojo_edk_deps | 14 # mojo_edk_deps |
15 | 15 |
16 # Note that it is assumed that the Mojo EDK is a sibling of the Mojo SDK in a | 16 # Note that it is assumed that the Mojo EDK is a sibling of the Mojo SDK in a |
17 # client repo; the distinctions made above are for the sake of clarity in | 17 # client repo; the distinctions made above are for the sake of clarity in |
18 # writing targets. | 18 # writing targets. |
19 template("mojo_edk_source_set") { | 19 template("mojo_edk_source_set") { |
20 mojo_sdk_source_set(target_name) { | 20 mojo_sdk_source_set(target_name) { |
21 restrict_external_deps = false | 21 restrict_external_deps = false |
22 | 22 |
23 if (defined(invoker.visibility)) { | 23 if (defined(invoker.visibility)) { |
24 visibility = invoker.visibility | 24 visibility = invoker.visibility |
25 } | 25 } |
26 if (defined(invoker.mojo_edk_visibility)) { | 26 if (defined(invoker.mojo_edk_visibility)) { |
27 mojo_sdk_visibility = invoker.mojo_edk_visibility | 27 mojo_sdk_visibility = invoker.mojo_edk_visibility |
28 } | 28 } |
29 if (defined(invoker.testonly)) { | 29 if (defined(invoker.testonly)) { |
30 testonly = invoker.testonly | 30 testonly = invoker.testonly |
31 } | 31 } |
32 if (defined(invoker.sources)) { | 32 if (defined(invoker.sources)) { |
(...skipping 21 matching lines...) Expand all Loading... |
54 | 54 |
55 allow_circular_includes_from = [] | 55 allow_circular_includes_from = [] |
56 if (defined(invoker.allow_circular_includes_from)) { | 56 if (defined(invoker.allow_circular_includes_from)) { |
57 allow_circular_includes_from += invoker.allow_circular_includes_from | 57 allow_circular_includes_from += invoker.allow_circular_includes_from |
58 } | 58 } |
59 if (defined(invoker.allow_circular_mojo_edk_includes_from)) { | 59 if (defined(invoker.allow_circular_mojo_edk_includes_from)) { |
60 foreach(edk_target, invoker.allow_circular_mojo_edk_includes_from) { | 60 foreach(edk_target, invoker.allow_circular_mojo_edk_includes_from) { |
61 # Check that the EDK target was not mistakenly given as an absolute | 61 # Check that the EDK target was not mistakenly given as an absolute |
62 # path. | 62 # path. |
63 assert(get_path_info(edk_target, "abspath") != edk_target) | 63 assert(get_path_info(edk_target, "abspath") != edk_target) |
64 allow_circular_includes_from += [ | 64 allow_circular_includes_from += |
65 rebase_path(edk_target, ".", mojo_root) | 65 [ rebase_path(edk_target, ".", mojo_root) ] |
66 ] | |
67 } | 66 } |
68 } | 67 } |
69 | 68 |
70 if (defined(invoker.public_deps)) { | 69 if (defined(invoker.public_deps)) { |
71 public_deps = invoker.public_deps | 70 public_deps = invoker.public_deps |
72 } | 71 } |
73 mojo_sdk_public_deps = [] | 72 mojo_sdk_public_deps = [] |
74 if (defined(invoker.mojo_edk_public_deps)) { | 73 if (defined(invoker.mojo_edk_public_deps)) { |
75 # The EDK is required to be a sibling of the SDK, so the relative | 74 # The EDK is required to be a sibling of the SDK, so the relative |
76 # dependencies are rewritten in the same way. | 75 # dependencies are rewritten in the same way. |
(...skipping 10 matching lines...) Expand all Loading... |
87 if (defined(invoker.mojo_edk_deps)) { | 86 if (defined(invoker.mojo_edk_deps)) { |
88 # The EDK is required to be a sibling of the SDK, so the relative | 87 # The EDK is required to be a sibling of the SDK, so the relative |
89 # dependencies are rewritten in the same way. | 88 # dependencies are rewritten in the same way. |
90 mojo_sdk_deps = invoker.mojo_edk_deps | 89 mojo_sdk_deps = invoker.mojo_edk_deps |
91 } | 90 } |
92 if (defined(invoker.mojo_sdk_deps)) { | 91 if (defined(invoker.mojo_sdk_deps)) { |
93 mojo_sdk_deps += invoker.mojo_sdk_deps | 92 mojo_sdk_deps += invoker.mojo_sdk_deps |
94 } | 93 } |
95 } | 94 } |
96 } | 95 } |
OLD | NEW |