Commit 2bb8fd94 authored by Maciek Kumorek's avatar Maciek Kumorek Committed by Commit Bot

Pass defines to MIDL compiler and define IDL UUIDs in .gn file.


The adopters of the updater project should be able to change the guids
of the COM service exposed by the updater.exe to prevent conflicts
when services are installed on the same machine. To make it easier to
deal with conflicts, we want the UUIDs to be defined outside of the .IDL.

This change allows for compile-time defines expressed in GN to be passed
to the midl.exe compiler.

Change-Id: I6764d1625fb01635c8426d3634ff6fcd7561ae27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2094711
Commit-Queue: Maciek Kumorek <makumo@microsoft.com>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751799}
parent c93b533d
...@@ -32,6 +32,10 @@ import("//build/config/win/visual_studio_version.gni") ...@@ -32,6 +32,10 @@ import("//build/config/win/visual_studio_version.gni")
# Whether a .tlb file should be added to outputs. Defaults to false. # Whether a .tlb file should be added to outputs. Defaults to false.
# #
# deps (optional) # deps (optional)
#
# defines (optional)
# Build time defines to be passed to midl.exe as /D parameter.
#
# visibility (optional) # visibility (optional)
template("midl") { template("midl") {
...@@ -127,6 +131,12 @@ template("midl") { ...@@ -127,6 +131,12 @@ template("midl") {
"/Oicf", "/Oicf",
] ]
if (defined(invoker.defines)) {
foreach(define, invoker.defines) {
args += [ "/D" + define ]
}
}
forward_variables_from(invoker, [ "deps" ]) forward_variables_from(invoker, [ "deps" ])
} }
......
...@@ -6,6 +6,12 @@ import("//build/toolchain/win/midl.gni") ...@@ -6,6 +6,12 @@ import("//build/toolchain/win/midl.gni")
midl("updater_idl_idl") { midl("updater_idl_idl") {
sources = [ "updater_idl.idl" ] sources = [ "updater_idl.idl" ]
defines = [
"IUPDATER_IID=63B8FFB1-5314-48C9-9C57-93EC8BC6184B",
"UPDATER_LIB_UUID=69464FF0-D9EC-4037-A35F-8AE4358106CC",
"UPDATER_CLSID=158428A4-6014-4978-83BA-9FAD0DABE791",
"UPDATER_SERVICE_UUID=415FD747-D79E-42D7-93AC-1BA6E5FD4E93",
]
writes_tlb = true writes_tlb = true
} }
......
...@@ -31,7 +31,7 @@ interface IUpdaterObserver : IUnknown { ...@@ -31,7 +31,7 @@ interface IUpdaterObserver : IUnknown {
[ [
object, object,
dual, dual,
uuid(63B8FFB1-5314-48C9-9C57-93EC8BC6184B), uuid(IUPDATER_IID),
helpstring("IUpdater Interface"), helpstring("IUpdater Interface"),
pointer_default(unique) pointer_default(unique)
] ]
...@@ -47,7 +47,7 @@ interface IUpdater : IUnknown { ...@@ -47,7 +47,7 @@ interface IUpdater : IUnknown {
}; };
[ [
uuid(69464FF0-D9EC-4037-A35F-8AE4358106CC), uuid(UPDATER_LIB_UUID),
version(1.0), version(1.0),
helpstring("Omaha 4.0 Type Library") helpstring("Omaha 4.0 Type Library")
] ]
...@@ -57,7 +57,7 @@ library UpdaterLib { ...@@ -57,7 +57,7 @@ library UpdaterLib {
interface IUpdater; interface IUpdater;
[ [
uuid(158428A4-6014-4978-83BA-9FAD0DABE791), uuid(UPDATER_CLSID),
helpstring("Updater Class") helpstring("Updater Class")
] ]
coclass UpdaterClass coclass UpdaterClass
...@@ -66,7 +66,7 @@ library UpdaterLib { ...@@ -66,7 +66,7 @@ library UpdaterLib {
} }
[ [
uuid(415FD747-D79E-42D7-93AC-1BA6E5FD4E93), uuid(UPDATER_SERVICE_UUID),
helpstring("Updater Service Class") helpstring("Updater Service Class")
] ]
coclass UpdaterServiceClass coclass UpdaterServiceClass
......
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