Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: mojo/public/mojo_sdk.gni

Issue 1410053006: Move third_party/mojo/src/mojo/public to mojo/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 # The absolute path to the directory containing the mojo public SDK (i.e., the
6 # directory containing mojo/public). The build files within the Mojo public
7 # SDK use this variable to allow themselves to be parameterized by the location
8 # of the public SDK within a client repo.
9 mojo_root = get_path_info("../..", "abspath")
10
11 # Takes as input a "source_set" that includes dependencies that are relative to 5 # Takes as input a "source_set" that includes dependencies that are relative to
12 # the parent directory of the Mojo public SDK (given in |mojo_sdk_deps|). 6 # the parent directory of the Mojo public SDK (given in |mojo_sdk_deps|).
13 # Generates a source_set that has the mojo_sdk_deps added as ordinary deps 7 # Generates a source_set that has the mojo_sdk_deps added as ordinary deps
14 # rebased to the current directory. 8 # rebased to the current directory.
15 # By default, restricts the entries that are given in invoker.deps and 9 # By default, restricts the entries that are given in invoker.deps and
16 # invoker.public_deps to be only within the same file and on a small set of 10 # invoker.public_deps to be only within the same file and on a small set of
17 # whitelisted external dependencies. This check can be elided by setting 11 # whitelisted external dependencies. This check can be elided by setting
18 # restrict_external_deps to false in the invoker. DO NOT DO THIS in 12 # restrict_external_deps to false in the invoker. DO NOT DO THIS in
19 # //mojo/public. 13 # //mojo/public.
20 # 14 #
(...skipping 26 matching lines...) Expand all
47 if (defined(invoker.visibility)) { 41 if (defined(invoker.visibility)) {
48 visibility = invoker.visibility 42 visibility = invoker.visibility
49 } else { 43 } else {
50 visibility = [ "*" ] 44 visibility = [ "*" ]
51 } 45 }
52 if (defined(invoker.mojo_sdk_visibility)) { 46 if (defined(invoker.mojo_sdk_visibility)) {
53 foreach(sdk_target, invoker.mojo_sdk_visibility) { 47 foreach(sdk_target, invoker.mojo_sdk_visibility) {
54 # Check that the SDK target was not mistakenly given as an absolute 48 # Check that the SDK target was not mistakenly given as an absolute
55 # path. 49 # path.
56 assert(get_path_info(sdk_target, "abspath") != sdk_target) 50 assert(get_path_info(sdk_target, "abspath") != sdk_target)
57 visibility += [ rebase_path(sdk_target, ".", mojo_root) ] 51 visibility += [ rebase_path(sdk_target, ".", "//") ]
58 } 52 }
59 } 53 }
60 54
61 if (defined(invoker.testonly)) { 55 if (defined(invoker.testonly)) {
62 testonly = invoker.testonly 56 testonly = invoker.testonly
63 } 57 }
64 58
65 if (defined(invoker.sources)) { 59 if (defined(invoker.sources)) {
66 sources = invoker.sources 60 sources = invoker.sources
67 } 61 }
68 62
69 if (defined(invoker.defines)) { 63 if (defined(invoker.defines)) {
70 defines = invoker.defines 64 defines = invoker.defines
71 } 65 }
72 66
73 if (defined(invoker.libs)) { 67 if (defined(invoker.libs)) {
74 libs = invoker.libs 68 libs = invoker.libs
75 } 69 }
76 70
77 public_configs = 71 public_configs = []
78 [ rebase_path("mojo/public/build/config:mojo_sdk", ".", mojo_root) ]
79 if (defined(invoker.public_configs)) { 72 if (defined(invoker.public_configs)) {
80 public_configs += invoker.public_configs 73 public_configs += invoker.public_configs
81 } 74 }
82 75
83 if (defined(invoker.configs)) { 76 if (defined(invoker.configs)) {
84 configs += invoker.configs 77 configs += invoker.configs
85 } 78 }
86 79
87 if (defined(invoker.allow_circular_includes_from)) { 80 if (defined(invoker.allow_circular_includes_from)) {
88 allow_circular_includes_from = invoker.allow_circular_includes_from 81 allow_circular_includes_from = invoker.allow_circular_includes_from
(...skipping 15 matching lines...) Expand all
104 # whitelisted set of external dependencies. 97 # whitelisted set of external dependencies.
105 assert(get_path_info(dep, "dir") == ".") 98 assert(get_path_info(dep, "dir") == ".")
106 } 99 }
107 public_deps += [ dep ] 100 public_deps += [ dep ]
108 } 101 }
109 } 102 }
110 if (defined(invoker.mojo_sdk_public_deps)) { 103 if (defined(invoker.mojo_sdk_public_deps)) {
111 foreach(sdk_dep, invoker.mojo_sdk_public_deps) { 104 foreach(sdk_dep, invoker.mojo_sdk_public_deps) {
112 # Check that the SDK dep was not mistakenly given as an absolute path. 105 # Check that the SDK dep was not mistakenly given as an absolute path.
113 assert(get_path_info(sdk_dep, "abspath") != sdk_dep) 106 assert(get_path_info(sdk_dep, "abspath") != sdk_dep)
114 public_deps += [ rebase_path(sdk_dep, ".", mojo_root) ] 107 public_deps += [ rebase_path(sdk_dep, ".", "//") ]
115 } 108 }
116 } 109 }
117 110
118 deps = [] 111 deps = []
119 if (defined(invoker.deps)) { 112 if (defined(invoker.deps)) {
120 foreach(dep, invoker.deps) { 113 foreach(dep, invoker.deps) {
121 if (restrict_external_deps) { 114 if (restrict_external_deps) {
122 # The only deps that are not specified relative to the location of 115 # The only deps that are not specified relative to the location of
123 # the Mojo SDK should be on targets within the same file or on a 116 # the Mojo SDK should be on targets within the same file or on a
124 # whitelisted set of external dependencies. 117 # whitelisted set of external dependencies.
125 dep_dir = get_path_info(dep, "dir") 118 dep_dir = get_path_info(dep, "dir")
126 assert(dep_dir == "." || dep == "//testing/gtest" || 119 assert(dep_dir == "." || dep == "//testing/gtest" ||
127 dep == "//mojo/environment:chromium" || 120 dep == "//mojo/environment:chromium" ||
128 dep == "//mojo/message_pump") 121 dep == "//mojo/message_pump")
129 } 122 }
130 deps += [ dep ] 123 deps += [ dep ]
131 } 124 }
132 } 125 }
133 if (defined(invoker.mojo_sdk_deps)) { 126 if (defined(invoker.mojo_sdk_deps)) {
134 foreach(sdk_dep, invoker.mojo_sdk_deps) { 127 foreach(sdk_dep, invoker.mojo_sdk_deps) {
135 # Check that the SDK dep was not mistakenly given as an absolute path. 128 # Check that the SDK dep was not mistakenly given as an absolute path.
136 assert(get_path_info(sdk_dep, "abspath") != sdk_dep) 129 assert(get_path_info(sdk_dep, "abspath") != sdk_dep)
137 deps += [ rebase_path(sdk_dep, ".", mojo_root) ] 130 deps += [ rebase_path(sdk_dep, ".", "//") ]
138 } 131 }
139 } 132 }
140 133
141 data_deps = [] 134 data_deps = []
142 if (defined(invoker.data_deps)) { 135 if (defined(invoker.data_deps)) {
143 data_deps = invoker.data_deps 136 data_deps = invoker.data_deps
144 } 137 }
145 } 138 }
146 } 139 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698