forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.gn
148 lines (124 loc) · 3.58 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chrome_build.gni")
import("//build/config/ui.gni")
import("//build/toolchain/win/midl.gni")
import("//chrome/process_version_rc_template.gni")
import("//testing/test.gni")
midl("elevation_service_idl") {
sources = [ "elevation_service_idl.idl" ]
writes_tlb = true
}
# Must be in a config because of how GN orders flags (otherwise /W4 will appear
# after this, and turn it back on).
config("no-missing-braces") {
# Macros invoked by WRL CoCreatableClass omit optional braces.
cflags = [ "-Wno-missing-braces" ]
}
# This service needs to work with Windows 7, so explicitly setting the defines
# to reflect this. Otherwise, WRL uses APIs that are only available in later
# Windows versions.
config("winver") {
defines = [
"NTDDI_VERSION=NTDDI_WIN7",
"_WIN32_WINNT=_WIN32_WINNT_WIN7",
"WINVER=_WIN32_WINNT_WIN7",
]
}
executable("elevation_service") {
sources = [
"elevation_service.cc",
"elevation_service.rc",
]
configs -= [
"//build/config/compiler:cet_shadow_stack",
"//build/config/win:console",
]
configs += [ "//build/config/win:windowed" ]
configs += [ ":no-missing-braces" ]
configs -= [ "//build/config/win:winver" ]
configs += [ ":winver" ]
deps = [
":lib",
":version_resources",
"//base",
"//build/win:default_exe_manifest",
"//chrome/install_static:install_static_util",
"//chrome/install_static:primary_module",
"//components/crx_file",
"//third_party/zlib/google:zip",
]
}
source_set("public_headers") {
sources = [ "elevator.h" ]
deps = [ "//base" ]
public_deps = [ ":elevation_service_idl" ]
}
source_set("lib") {
visibility = [ ":*" ]
sources = [
"caller_validation.cc",
"caller_validation.h",
"elevated_recovery_impl.cc",
"elevated_recovery_impl.h",
"elevator.cc",
"service_main.cc",
"service_main.h",
]
configs += [ ":no-missing-braces" ]
configs -= [ "//build/config/win:winver" ]
configs += [ ":winver" ]
deps = [
"//base",
"//chrome/install_static:install_static_util",
"//components/crx_file:crx_file",
"//third_party/zlib/google:zip",
]
public_deps = [ ":public_headers" ]
libs = [
"crypt32.lib",
"rpcrt4.lib",
]
}
process_version_rc_template("version_resources") {
sources = [ "elevation_service_exe.ver" ]
output = "$target_gen_dir/elevation_service_exe.rc"
}
copy("elevation_service_unittests_files") {
sources = [
"//components/test/data/crx_file/valid_no_publisher.crx3",
"//components/test/data/crx_file/valid_publisher.crx3",
"//components/test/data/update_client/ChromeRecovery.crx3",
]
outputs = [ "$root_out_dir/elevated_recovery_unittest/{{source_file_part}}" ]
}
test("elevation_service_unittests") {
use_xvfb = use_xvfb_in_this_config
sources = [
"caller_validation_unittest.cc",
"elevated_recovery_unittest.cc",
"elevator_unittest.cc",
"run_all_unittests.cc",
"scoped_mock_context.cc",
"scoped_mock_context.h",
"service_main_unittest.cc",
]
configs -= [ "//build/config/win:winver" ]
configs += [ ":winver" ]
deps = [
":lib",
"//base",
"//base/test:test_support",
"//chrome/elevation_service:elevation_service_idl",
"//chrome/install_static:install_static_util",
"//chrome/install_static/test:test_support",
"//components/crx_file",
"//testing/gtest",
"//third_party/zlib/google:zip",
]
data_deps = [
":elevation_service",
":elevation_service_unittests_files",
]
}