| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 # HOW MANIFESTS WORK IN THE GN BUILD | 5 # HOW MANIFESTS WORK IN THE GN BUILD |
| 6 # | 6 # |
| 7 # Use the windows_manifest template to declare a manifest generation step. | 7 # Use the windows_manifest template to declare a manifest generation step. |
| 8 # This will combine all listed .manifest files and generate a resource file | 8 # This will combine all listed .manifest files and generate a resource file |
| 9 # referencing the resulting manifest. To link this manifest, just depend on | 9 # referencing the resulting manifest. To link this manifest, just depend on |
| 10 # the manifest target from your executable or shared library. | 10 # the manifest target from your executable or shared library. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 _environment_file, | 106 _environment_file, |
| 107 "mt.exe", | 107 "mt.exe", |
| 108 "-nologo", | 108 "-nologo", |
| 109 "-manifest", | 109 "-manifest", |
| 110 ] | 110 ] |
| 111 args += rebase_path(invoker.sources, root_build_dir) | 111 args += rebase_path(invoker.sources, root_build_dir) |
| 112 args += [ "-out:" + rebase_path(output_manifest, root_build_dir) ] | 112 args += [ "-out:" + rebase_path(output_manifest, root_build_dir) ] |
| 113 | 113 |
| 114 # Apply any dependencies from the invoker to this target, since those | 114 # Apply any dependencies from the invoker to this target, since those |
| 115 # dependencies may have created the input manifest files. | 115 # dependencies may have created the input manifest files. |
| 116 if (defined(invoker.deps)) { | 116 forward_variables_from(invoker, [ "deps" ]) |
| 117 deps = invoker.deps | |
| 118 } | |
| 119 } | 117 } |
| 120 | 118 |
| 121 # Make the .rc file that references the final manifest file. The manifest | 119 # Make the .rc file that references the final manifest file. The manifest |
| 122 # generation doesn't need to be a dependency because it's not actually | 120 # generation doesn't need to be a dependency because it's not actually |
| 123 # needed until the .rc is compiled. | 121 # needed until the .rc is compiled. |
| 124 # | 122 # |
| 125 # This could easily be combined into one step, but this current separation | 123 # This could easily be combined into one step, but this current separation |
| 126 # of .manifest and .rc matches GYP and allows us to re-use gyp-win-tool. | 124 # of .manifest and .rc matches GYP and allows us to re-use gyp-win-tool. |
| 127 action(rc_action_name) { | 125 action(rc_action_name) { |
| 128 visibility = [ ":$source_set_name" ] | 126 visibility = [ ":$source_set_name" ] |
| (...skipping 19 matching lines...) Expand all Loading... |
| 148 "manifest-to-rc", | 146 "manifest-to-rc", |
| 149 "$_environment_file", | 147 "$_environment_file", |
| 150 rebase_path(output_manifest), | 148 rebase_path(output_manifest), |
| 151 rebase_path(rcfile, root_build_dir), | 149 rebase_path(rcfile, root_build_dir), |
| 152 manifest_resource_id, | 150 manifest_resource_id, |
| 153 ] | 151 ] |
| 154 } | 152 } |
| 155 | 153 |
| 156 # This source set only exists to compile and link the resource file. | 154 # This source set only exists to compile and link the resource file. |
| 157 source_set(source_set_name) { | 155 source_set(source_set_name) { |
| 158 if (defined(invoker.visibility)) { | 156 forward_variables_from(invoker, [ "visibility" ]) |
| 159 visibility = invoker.visibility | |
| 160 } | |
| 161 sources = [ | 157 sources = [ |
| 162 rcfile, | 158 rcfile, |
| 163 ] | 159 ] |
| 164 deps = [ | 160 deps = [ |
| 165 ":$manifest_action_name", | 161 ":$manifest_action_name", |
| 166 ":$rc_action_name", | 162 ":$rc_action_name", |
| 167 ] | 163 ] |
| 168 } | 164 } |
| 169 } | 165 } |
| 170 } else { | 166 } else { |
| 171 # Make a no-op group on non-Windows platforms so windows_manifest | 167 # Make a no-op group on non-Windows platforms so windows_manifest |
| 172 # instantiations don't need to be inside windows blocks. | 168 # instantiations don't need to be inside windows blocks. |
| 173 template("windows_manifest") { | 169 template("windows_manifest") { |
| 174 group(target_name) { | 170 group(target_name) { |
| 175 # Prevent unused variable warnings on non-Windows platforms. | 171 # Prevent unused variable warnings on non-Windows platforms. |
| 176 assert(invoker.type == "exe" || invoker.type == "dll") | 172 assert(invoker.type == "exe" || invoker.type == "dll") |
| 177 assert(invoker.sources != "") | 173 assert(invoker.sources != "") |
| 178 assert(!defined(invoker.deps) || invoker.deps != "") | 174 assert(!defined(invoker.deps) || invoker.deps != "") |
| 179 assert(!defined(invoker.visibility) || invoker.visibility != "") | 175 assert(!defined(invoker.visibility) || invoker.visibility != "") |
| 180 } | 176 } |
| 181 } | 177 } |
| 182 } | 178 } |
| OLD | NEW |