Commit bf94f9d2 authored by brettw@chromium.org's avatar brettw@chromium.org

Add GN support for midl.

Implement iaccessible and isimpledom

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/330413002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277855 0039d316-1c4b-4281-b951-d872f2087c98
parent a97b1372
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_win)
# This template defines a rule to invoke the MS IDL compiler.
#
# Parameters
#
# sources
# List of .idl file to process.
#
# out_dir (optional)
# Directory to write the generated files to. Defaults to target_gen_dir.
#
# visibility (optional)
template("midl") {
action_name = "${target_name}_idl_action"
source_set_name = target_name
assert(defined(invoker.sources), "Source must be defined for $target_name")
if (defined(invoker.out_dir)) {
out_dir = invoker.out_dir
} else {
out_dir = target_gen_dir
}
header_file = "{{source_name_part}}.h"
dlldata_file = "{{source_name_part}}.dlldata.c"
interface_identifier_file = "{{source_name_part}}_i.c"
proxy_file = "{{source_name_part}}_p.c"
type_library_file = "{{source_name_part}}.tlb"
action_foreach(action_name) {
visibility = ":$source_set_name"
# This functionality is handled by the win-tool because the GYP build has
# MIDL support built-in.
# TODO(brettw) move this to a separate MIDL wrapper script for better
# clarity once GYP support is not needed.
script = "$root_build_dir/gyp-win-tool"
sources = invoker.sources
# Note that .tlb is not included in the outputs as it is not always
# generated depending on the content of the input idl file.
outputs = [
"$out_dir/$header_file",
"$out_dir/$dlldata_file",
"$out_dir/$interface_identifier_file",
"$out_dir/$proxy_file",
]
if (cpu_arch == "x86") {
win_tool_arch = "environment.x86"
idl_target_platform = "win32"
} else if (cpu_arch == "x64") {
win_tool_arch = "environment.x64"
idl_target_platform = "x64"
} else {
assert(false, "Need environment for this arch")
}
args = [
"midl-wrapper", win_tool_arch,
rebase_path(out_dir, root_build_dir),
type_library_file,
header_file,
dlldata_file,
interface_identifier_file,
proxy_file,
"{{source}}",
"/char", "signed",
"/env", idl_target_platform,
"/Oicf",
]
}
source_set(target_name) {
if (defined(invoker.visibility)) {
visibility = invoker.visibility
}
# We only compile the IID files from the IDL tool rather than all outputs.
sources = process_file_template(
invoker.sources,
[ "$out_dir/$interface_identifier_file" ])
deps = [ ":$action_name" ]
}
}
......@@ -24,6 +24,7 @@ def ExtractImportantEnvironment():
current environment."""
envvars_to_save = (
'goma_.*', # TODO(scottmg): This is ugly, but needed for goma.
'include', # Needed by midl compiler.
'path',
'pathext',
'systemroot',
......
......@@ -182,9 +182,8 @@ source_set("browser") {
"__ATLHOST_H__",
]
deps += [
# TODO(GYP)
#"//third_party/iaccessible2",
#"//third_party/isimpledom",
"//third_party/iaccessible2",
"//third_party/isimpledom",
]
libs += [
"comctl32.lib",
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_win)
import("//build/toolchain/win/midl.gni")
midl("iaccessible2") {
sources = [
"ia2_api_all.idl",
]
}
# Generate a proxy DLL from the generated code.
shared_library("IAccessible2Proxy") {
sources = [
"IAccessible2Proxy.def",
"$target_gen_dir/ia2_api_all.dlldata.c",
"$target_gen_dir/ia2_api_all_p.c",
]
defines = [ "REGISTER_PROXY_DLL" ]
libs = [ "rpcrt4.lib" ]
deps = [ ":iaccessible2" ]
}
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_win)
import("//build/toolchain/win/midl.gni")
midl("isimpledom") {
sources = [
"ISimpleDOMDocument.idl",
"ISimpleDOMNode.idl",
"ISimpleDOMText.idl",
]
# Note: GYP version sets 'GenerateTypeLibrary': 'false'. It doesn't seem to
# be harmful to generate this, however.
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment