| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 # default_compatibility_manifest, # Want the normal OS compat list. | 69 # default_compatibility_manifest, # Want the normal OS compat list. |
| 70 # ] | 70 # ] |
| 71 # type = "exe" | 71 # type = "exe" |
| 72 # } | 72 # } |
| 73 # | 73 # |
| 74 # executable("doom_melon") { | 74 # executable("doom_melon") { |
| 75 # deps = [ ":doom_melon_manifest" ] | 75 # deps = [ ":doom_melon_manifest" ] |
| 76 # ... | 76 # ... |
| 77 # } | 77 # } |
| 78 | 78 |
| 79 if (is_win) { | 79 if (is_win && host_os == "win") { # XXX |
| 80 # This is the environment file that gyp-win-tool will use for the current | 80 # This is the environment file that gyp-win-tool will use for the current |
| 81 # toolchain. It is placed in root_build_dir by the toolchain setup. This | 81 # toolchain. It is placed in root_build_dir by the toolchain setup. This |
| 82 # variable is the path relative to the root_build_dir which is what | 82 # variable is the path relative to the root_build_dir which is what |
| 83 # gyp-win-tool expects as an argument. | 83 # gyp-win-tool expects as an argument. |
| 84 _environment_file = "environment.$current_cpu" | 84 _environment_file = "environment.$current_cpu" |
| 85 | 85 |
| 86 template("windows_manifest") { | 86 template("windows_manifest") { |
| 87 manifest_action_name = "${target_name}__gen_manifest" | 87 manifest_action_name = "${target_name}__gen_manifest" |
| 88 rc_action_name = "${target_name}__gen_rc" | 88 rc_action_name = "${target_name}__gen_rc" |
| 89 source_set_name = target_name | 89 source_set_name = target_name |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 rebase_path(output_manifest), | 153 rebase_path(output_manifest), |
| 154 rebase_path(rcfile, root_build_dir), | 154 rebase_path(rcfile, root_build_dir), |
| 155 manifest_resource_id, | 155 manifest_resource_id, |
| 156 ] | 156 ] |
| 157 | 157 |
| 158 # Although generating this file doesn't technically depend on the | 158 # Although generating this file doesn't technically depend on the |
| 159 # generated manifest, this dependency causes the .rc timestamp to be | 159 # generated manifest, this dependency causes the .rc timestamp to be |
| 160 # updated every time the manifest is updated. Otherwise, updating the | 160 # updated every time the manifest is updated. Otherwise, updating the |
| 161 # manifest will not cause a recompilation of the .rc file. | 161 # manifest will not cause a recompilation of the .rc file. |
| 162 deps = [ | 162 deps = [ |
| 163 ":$manifest_action_name", | 163 #":$manifest_action_name", |
| 164 ] | 164 ] |
| 165 } | 165 } |
| 166 | 166 |
| 167 # This source set only exists to compile and link the resource file. | 167 # This source set only exists to compile and link the resource file. |
| 168 source_set(source_set_name) { | 168 source_set(source_set_name) { |
| 169 forward_variables_from(invoker, [ "visibility" ]) | 169 forward_variables_from(invoker, [ "visibility" ]) |
| 170 sources = [ | 170 sources = [ |
| 171 rcfile, | 171 rcfile, |
| 172 ] | 172 ] |
| 173 deps = [ | 173 deps = [ |
| 174 ":$manifest_action_name", | 174 #":$manifest_action_name", |
| 175 ":$rc_action_name", | 175 #":$rc_action_name", |
| 176 ] | 176 ] |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 } else { | 179 } else { |
| 180 # Make a no-op group on non-Windows platforms so windows_manifest | 180 # Make a no-op group on non-Windows platforms so windows_manifest |
| 181 # instantiations don't need to be inside windows blocks. | 181 # instantiations don't need to be inside windows blocks. |
| 182 template("windows_manifest") { | 182 template("windows_manifest") { |
| 183 group(target_name) { | 183 group(target_name) { |
| 184 # Prevent unused variable warnings on non-Windows platforms. | 184 # Prevent unused variable warnings on non-Windows platforms. |
| 185 assert(invoker.type == "exe" || invoker.type == "dll") | 185 assert(invoker.type == "exe" || invoker.type == "dll") |
| 186 assert(invoker.sources != "") | 186 assert(invoker.sources != "") |
| 187 assert(!defined(invoker.deps) || invoker.deps != "") | 187 assert(!defined(invoker.deps) || invoker.deps != "") |
| 188 assert(!defined(invoker.visibility) || invoker.visibility != "") | 188 assert(!defined(invoker.visibility) || invoker.visibility != "") |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 } | 191 } |
| OLD | NEW |