blob: 3088437c3483de9d34e72b223e93b41b91f22122 [file] [log] [blame]
xingao03d52e22017-11-21 08:20:29 -08001# Copyright 2016 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +000015major_version: "local"
16minor_version: ""
namrata-ibm155bd642016-10-11 09:59:27 +000017
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +000018# Android tooling requires a default toolchain for the armeabi-v7a cpu.
19toolchain {
20 abi_version: "armeabi-v7a"
21 abi_libc_version: "armeabi-v7a"
22 builtin_sysroot: ""
23 compiler: "compiler"
24 host_system_name: "armeabi-v7a"
25 needsPic: true
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +000026 supports_incremental_linker: false
27 supports_fission: false
28 supports_interface_shared_objects: false
29 supports_normalizing_ar: false
30 supports_start_end_lib: false
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +000031 target_libc: "armeabi-v7a"
32 target_cpu: "armeabi-v7a"
33 target_system_name: "armeabi-v7a"
34 toolchain_identifier: "stub_armeabi-v7a"
35
36 tool_path { name: "ar" path: "/bin/false" }
37 tool_path { name: "compat-ld" path: "/bin/false" }
38 tool_path { name: "cpp" path: "/bin/false" }
39 tool_path { name: "dwp" path: "/bin/false" }
40 tool_path { name: "gcc" path: "/bin/false" }
41 tool_path { name: "gcov" path: "/bin/false" }
42 tool_path { name: "ld" path: "/bin/false" }
43
44 tool_path { name: "nm" path: "/bin/false" }
45 tool_path { name: "objcopy" path: "/bin/false" }
46 tool_path { name: "objdump" path: "/bin/false" }
47 tool_path { name: "strip" path: "/bin/false" }
48 linking_mode_flags { mode: DYNAMIC }
49}
50
51toolchain {
Yun Pengc77eac92017-03-08 13:54:06 +000052 toolchain_identifier: "%{toolchain_name}"
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +000053%{content}
54
55 compilation_mode_flags {
56 mode: DBG
57%{dbg_content}
58 }
59 compilation_mode_flags {
60 mode: OPT
61%{opt_content}
62 }
63 linking_mode_flags { mode: DYNAMIC }
Marcel Hlopko71c72c12017-02-23 14:10:31 +000064
65%{coverage}
Benjamin Petersonb9e1c8a2017-12-05 06:27:26 -080066
67 feature {
68 name: 'fdo_optimize'
69 provides: 'profile'
70 flag_set {
71 action: 'c-compile'
72 action: 'c++-compile'
Benjamin Petersonb9e1c8a2017-12-05 06:27:26 -080073 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -080074 expand_if_all_available: 'fdo_profile_path'
Benjamin Petersonb9e1c8a2017-12-05 06:27:26 -080075 flag: '-fprofile-use=%{fdo_profile_path}'
76 flag: '-fprofile-correction',
77 }
78 }
79 }
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +000080}
Yun Peng56b16e72016-07-12 10:55:57 +000081
82toolchain {
Yun Penge9f40902018-01-03 09:20:27 -080083 toolchain_identifier: "msys_x64_mingw"
84 abi_version: "local"
85 abi_libc_version: "local"
86 builtin_sysroot: ""
87 compiler: "mingw-gcc"
88 host_system_name: "local"
89 needsPic: false
90 target_libc: "mingw"
91 target_cpu: "x64_windows"
92 target_system_name: "local"
93
Yun Peng5c4f3b52018-05-22 06:38:08 -070094 artifact_name_pattern {
95 category_name: 'executable'
96 prefix: ''
97 extension: '.exe'
98 }
99
Yun Penge9f40902018-01-03 09:20:27 -0800100%{msys_x64_mingw_content}
101
102 linking_mode_flags { mode: DYNAMIC }
103}
104
105toolchain {
Yun Pengc77eac92017-03-08 13:54:06 +0000106 toolchain_identifier: "msvc_x64"
Yun Peng56b16e72016-07-12 10:55:57 +0000107 host_system_name: "local"
108 target_system_name: "local"
109
110 abi_version: "local"
111 abi_libc_version: "local"
Yun Pengc77eac92017-03-08 13:54:06 +0000112 target_cpu: "x64_windows"
Yun Penge9f40902018-01-03 09:20:27 -0800113 compiler: "msvc-cl"
114 target_libc: "msvcrt"
Yun Peng56b16e72016-07-12 10:55:57 +0000115 default_python_version: "python2.7"
116
117%{cxx_builtin_include_directory}
118
119 tool_path {
120 name: "ar"
Yun Peng284a6112017-06-06 05:32:34 -0400121 path: "%{msvc_lib_path}"
Yun Peng56b16e72016-07-12 10:55:57 +0000122 }
123 tool_path {
Seth Greensteinae760d22017-11-17 02:20:06 -0800124 name: "ml"
125 path: "%{msvc_ml_path}"
126 }
127 tool_path {
Yun Peng56b16e72016-07-12 10:55:57 +0000128 name: "cpp"
Yun Peng284a6112017-06-06 05:32:34 -0400129 path: "%{msvc_cl_path}"
Yun Peng56b16e72016-07-12 10:55:57 +0000130 }
131 tool_path {
132 name: "gcc"
Yun Peng284a6112017-06-06 05:32:34 -0400133 path: "%{msvc_cl_path}"
Yun Peng56b16e72016-07-12 10:55:57 +0000134 }
135 tool_path {
136 name: "gcov"
137 path: "wrapper/bin/msvc_nop.bat"
138 }
139 tool_path {
140 name: "ld"
Yun Peng284a6112017-06-06 05:32:34 -0400141 path: "%{msvc_link_path}"
Yun Peng56b16e72016-07-12 10:55:57 +0000142 }
143 tool_path {
144 name: "nm"
145 path: "wrapper/bin/msvc_nop.bat"
146 }
147 tool_path {
148 name: "objcopy"
149 path: "wrapper/bin/msvc_nop.bat"
150 }
151 tool_path {
152 name: "objdump"
153 path: "wrapper/bin/msvc_nop.bat"
154 }
155 tool_path {
156 name: "strip"
157 path: "wrapper/bin/msvc_nop.bat"
158 }
Yun Peng56b16e72016-07-12 10:55:57 +0000159 supports_start_end_lib: false
Yun Peng394211b2017-09-15 15:59:14 +0200160 supports_interface_shared_objects: true
Yun Peng56b16e72016-07-12 10:55:57 +0000161 supports_incremental_linker: false
162 supports_normalizing_ar: true
163 needsPic: false
164
Yun Peng56b16e72016-07-12 10:55:57 +0000165 # TODO(pcloudy): Review those flags below, they should be defined by cl.exe
Yun Peng56b16e72016-07-12 10:55:57 +0000166 compiler_flag: "/DCOMPILER_MSVC"
167
pcloudyb9554c12017-07-10 14:09:16 +0200168 # Don't define min/max macros in windows.h.
169 compiler_flag: "/DNOMINMAX"
170
Yun Peng56b16e72016-07-12 10:55:57 +0000171 # Platform defines.
pcloudy0bef1f22018-10-05 00:23:50 -0700172 compiler_flag: "/D_WIN32_WINNT=0x0601"
Yun Peng56b16e72016-07-12 10:55:57 +0000173 # Turn off warning messages.
174 compiler_flag: "/D_CRT_SECURE_NO_DEPRECATE"
175 compiler_flag: "/D_CRT_SECURE_NO_WARNINGS"
Yun Peng56b16e72016-07-12 10:55:57 +0000176
177 # Useful options to have on for compilation.
Yun Peng56b16e72016-07-12 10:55:57 +0000178 # Increase the capacity of object files to 2^32 sections.
179 compiler_flag: "/bigobj"
180 # Allocate 500MB for precomputed headers.
181 compiler_flag: "/Zm500"
Samer Mastersonfefd1b22018-03-02 01:21:37 -0800182 # Catch C++ exceptions only and tell the compiler to assume that functions declared
183 # as extern "C" never throw a C++ exception.
Yun Peng56b16e72016-07-12 10:55:57 +0000184 compiler_flag: "/EHsc"
185
186 # Globally disabled warnings.
187 # Don't warn about elements of array being be default initialized.
188 compiler_flag: "/wd4351"
189 # Don't warn about no matching delete found.
190 compiler_flag: "/wd4291"
191 # Don't warn about diamond inheritance patterns.
192 compiler_flag: "/wd4250"
193 # Don't warn about insecure functions (e.g. non _s functions).
194 compiler_flag: "/wd4996"
195
Yun Pengf3fd3a42017-04-24 13:37:46 +0200196 linker_flag: "/MACHINE:X64"
197
hlopko26e5a472017-07-05 14:06:39 -0400198 feature {
199 name: "no_legacy_features"
200 }
201
Yun Peng5c4f3b52018-05-22 06:38:08 -0700202 artifact_name_pattern {
203 category_name: 'object_file'
204 prefix: ''
205 extension: '.obj'
206 }
207
208 artifact_name_pattern {
209 category_name: 'static_library'
210 prefix: ''
211 extension: '.lib'
212 }
213
214 artifact_name_pattern {
215 category_name: 'alwayslink_static_library'
216 prefix: ''
217 extension: '.lo.lib'
218 }
219
220 artifact_name_pattern {
221 category_name: 'executable'
222 prefix: ''
223 extension: '.exe'
224 }
225
226 artifact_name_pattern {
227 category_name: 'dynamic_library'
228 prefix: ''
229 extension: '.dll'
230 }
231
232 artifact_name_pattern {
233 category_name: 'interface_library'
234 prefix: ''
235 extension: '.if.lib'
236 }
237
Yun Pengf3fd3a42017-04-24 13:37:46 +0200238 # Suppress startup banner.
239 feature {
240 name: "nologo"
241 flag_set {
242 action: "c-compile"
243 action: "c++-compile"
244 action: "c++-module-compile"
245 action: "c++-module-codegen"
246 action: "c++-header-parsing"
Yun Pengf3fd3a42017-04-24 13:37:46 +0200247 action: "assemble"
248 action: "preprocess-assemble"
249 action: "c++-link-executable"
250 action: "c++-link-dynamic-library"
hlopkodad22762018-03-01 13:17:23 -0800251 action: "c++-link-nodeps-dynamic-library"
Yun Pengf3fd3a42017-04-24 13:37:46 +0200252 action: "c++-link-static-library"
Yun Pengf3fd3a42017-04-24 13:37:46 +0200253 flag_group {
254 flag: "/nologo"
255 }
256 }
257 }
Yun Peng56b16e72016-07-12 10:55:57 +0000258
Yun Peng394211b2017-09-15 15:59:14 +0200259 feature {
260 name: 'has_configured_linker_path'
261 }
262
Yun Peng02866942017-08-04 10:45:46 +0200263 # This feature indicates strip is not supported, building stripped binary will just result a copy of orignial binary
264 feature {
265 name: 'no_stripping'
266 }
267
Yun Peng394211b2017-09-15 15:59:14 +0200268 # This feature indicates this is a toolchain targeting Windows.
269 feature {
270 name: 'targets_windows'
Yun Peng481657d2017-09-20 10:25:48 +0200271 implies: 'copy_dynamic_libraries_to_binary'
Yun Peng394211b2017-09-15 15:59:14 +0200272 enabled: true
273 }
274
Yun Peng481657d2017-09-20 10:25:48 +0200275 feature {
276 name: 'copy_dynamic_libraries_to_binary'
277 }
278
Yun Peng56b16e72016-07-12 10:55:57 +0000279 action_config {
Seth Greensteinae760d22017-11-17 02:20:06 -0800280 config_name: 'assemble'
281 action_name: 'assemble'
282 tool {
283 tool_path: '%{msvc_ml_path}'
284 }
hlopko6f1a2ec2018-05-16 12:32:32 -0700285 implies: 'compiler_input_flags'
286 implies: 'compiler_output_flags'
Seth Greensteinae760d22017-11-17 02:20:06 -0800287 implies: 'nologo'
288 implies: 'msvc_env'
289 implies: 'sysroot'
290 }
291
292 action_config {
pcloudy381b3a12018-07-02 04:23:31 -0700293 config_name: 'preprocess-assemble'
294 action_name: 'preprocess-assemble'
295 tool {
296 tool_path: '%{msvc_ml_path}'
297 }
298 implies: 'compiler_input_flags'
299 implies: 'compiler_output_flags'
300 implies: 'nologo'
301 implies: 'msvc_env'
302 implies: 'sysroot'
303 }
304
305 action_config {
Yun Peng56b16e72016-07-12 10:55:57 +0000306 config_name: 'c-compile'
307 action_name: 'c-compile'
308 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400309 tool_path: '%{msvc_cl_path}'
Yun Peng56b16e72016-07-12 10:55:57 +0000310 }
hlopko6f1a2ec2018-05-16 12:32:32 -0700311 implies: 'compiler_input_flags'
312 implies: 'compiler_output_flags'
hlopkof322ba72017-09-08 15:17:18 +0200313 implies: 'legacy_compile_flags'
Yun Pengf3fd3a42017-04-24 13:37:46 +0200314 implies: 'nologo'
Yun Peng6a0ddd82017-04-05 13:52:28 +0000315 implies: 'msvc_env'
Yun Peng29d5e9c2017-04-25 14:21:41 +0200316 implies: 'parse_showincludes'
hlopkof322ba72017-09-08 15:17:18 +0200317 implies: 'user_compile_flags'
hlopkob05bff62017-09-12 10:51:44 +0200318 implies: 'sysroot'
hlopkof322ba72017-09-08 15:17:18 +0200319 implies: 'unfiltered_compile_flags'
Yun Peng56b16e72016-07-12 10:55:57 +0000320 }
321
322 action_config {
323 config_name: 'c++-compile'
324 action_name: 'c++-compile'
325 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400326 tool_path: '%{msvc_cl_path}'
Yun Peng56b16e72016-07-12 10:55:57 +0000327 }
hlopko6f1a2ec2018-05-16 12:32:32 -0700328 implies: 'compiler_input_flags'
329 implies: 'compiler_output_flags'
hlopkof322ba72017-09-08 15:17:18 +0200330 implies: 'legacy_compile_flags'
Yun Pengf3fd3a42017-04-24 13:37:46 +0200331 implies: 'nologo'
Yun Peng6a0ddd82017-04-05 13:52:28 +0000332 implies: 'msvc_env'
Yun Peng29d5e9c2017-04-25 14:21:41 +0200333 implies: 'parse_showincludes'
hlopkof322ba72017-09-08 15:17:18 +0200334 implies: 'user_compile_flags'
hlopkob05bff62017-09-12 10:51:44 +0200335 implies: 'sysroot'
hlopkof322ba72017-09-08 15:17:18 +0200336 implies: 'unfiltered_compile_flags'
Yun Peng56b16e72016-07-12 10:55:57 +0000337 }
338
Yun Peng81aede12016-10-25 13:49:28 +0000339 action_config {
hlopko21903f92017-04-27 17:37:31 +0200340 config_name: 'c++-link-executable'
341 action_name: 'c++-link-executable'
342 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400343 tool_path: '%{msvc_link_path}'
hlopko21903f92017-04-27 17:37:31 +0200344 }
345 implies: 'nologo'
hlopko21903f92017-04-27 17:37:31 +0200346 implies: 'linkstamps'
347 implies: 'output_execpath_flags'
348 implies: 'input_param_flags'
hlopko2661abb2018-05-16 22:45:06 -0700349 implies: 'user_link_flags'
hlopko21903f92017-04-27 17:37:31 +0200350 implies: 'legacy_link_flags'
Laszlo Csomor1a636442017-07-20 12:38:02 +0200351 implies: 'linker_subsystem_flag'
hlopko21903f92017-04-27 17:37:31 +0200352 implies: 'linker_param_file'
353 implies: 'msvc_env'
Yun Peng02866942017-08-04 10:45:46 +0200354 implies: 'no_stripping'
Yun Peng81aede12016-10-25 13:49:28 +0000355 }
356
357 action_config {
hlopko21903f92017-04-27 17:37:31 +0200358 config_name: 'c++-link-dynamic-library'
359 action_name: 'c++-link-dynamic-library'
360 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400361 tool_path: '%{msvc_link_path}'
hlopko21903f92017-04-27 17:37:31 +0200362 }
363 implies: 'nologo'
hlopko21903f92017-04-27 17:37:31 +0200364 implies: 'shared_flag'
365 implies: 'linkstamps'
366 implies: 'output_execpath_flags'
367 implies: 'input_param_flags'
hlopko2661abb2018-05-16 22:45:06 -0700368 implies: 'user_link_flags'
hlopko21903f92017-04-27 17:37:31 +0200369 implies: 'legacy_link_flags'
Laszlo Csomor1a636442017-07-20 12:38:02 +0200370 implies: 'linker_subsystem_flag'
hlopko21903f92017-04-27 17:37:31 +0200371 implies: 'linker_param_file'
372 implies: 'msvc_env'
Yun Peng02866942017-08-04 10:45:46 +0200373 implies: 'no_stripping'
Yun Peng394211b2017-09-15 15:59:14 +0200374 implies: 'has_configured_linker_path'
Yun Peng9cc954a2017-11-14 01:45:02 -0800375 implies: 'def_file'
Yun Peng81aede12016-10-25 13:49:28 +0000376 }
377
378 action_config {
hlopkodad22762018-03-01 13:17:23 -0800379 config_name: 'c++-link-nodeps-dynamic-library'
380 action_name: 'c++-link-nodeps-dynamic-library'
381 tool {
382 tool_path: '%{msvc_link_path}'
383 }
384 implies: 'nologo'
385 implies: 'shared_flag'
386 implies: 'linkstamps'
387 implies: 'output_execpath_flags'
388 implies: 'input_param_flags'
hlopko2661abb2018-05-16 22:45:06 -0700389 implies: 'user_link_flags'
hlopkodad22762018-03-01 13:17:23 -0800390 implies: 'legacy_link_flags'
391 implies: 'linker_subsystem_flag'
392 implies: 'linker_param_file'
393 implies: 'msvc_env'
hlopkodad22762018-03-01 13:17:23 -0800394 implies: 'no_stripping'
395 implies: 'has_configured_linker_path'
396 implies: 'def_file'
397 }
398
399 action_config {
hlopko21903f92017-04-27 17:37:31 +0200400 config_name: 'c++-link-static-library'
401 action_name: 'c++-link-static-library'
402 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400403 tool_path: '%{msvc_lib_path}'
hlopko21903f92017-04-27 17:37:31 +0200404 }
405 implies: 'nologo'
hlopkoa4697fd2017-06-01 10:14:40 +0200406 implies: 'archiver_flags'
hlopko21903f92017-04-27 17:37:31 +0200407 implies: 'input_param_flags'
408 implies: 'linker_param_file'
409 implies: 'msvc_env'
Yun Peng81aede12016-10-25 13:49:28 +0000410 }
411
hlopkof322ba72017-09-08 15:17:18 +0200412 # TODO(b/65151735): Remove legacy_compile_flags feature when legacy fields are
413 # not used in this crosstool
414 feature {
415 name: 'legacy_compile_flags'
416 flag_set {
hlopkof322ba72017-09-08 15:17:18 +0200417 action: 'preprocess-assemble'
418 action: 'c-compile'
419 action: 'c++-compile'
420 action: 'c++-header-parsing'
hlopkof322ba72017-09-08 15:17:18 +0200421 action: 'c++-module-compile'
422 action: 'c++-module-codegen'
423 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800424 expand_if_all_available: 'legacy_compile_flags'
hlopkof322ba72017-09-08 15:17:18 +0200425 iterate_over: 'legacy_compile_flags'
426 flag: '%{legacy_compile_flags}'
427 }
428 }
429 }
430
431 feature {
432 name: "msvc_env"
433 env_set {
434 action: "c-compile"
435 action: "c++-compile"
436 action: "c++-module-compile"
437 action: "c++-module-codegen"
438 action: "c++-header-parsing"
hlopkof322ba72017-09-08 15:17:18 +0200439 action: "assemble"
440 action: "preprocess-assemble"
441 action: "c++-link-executable"
442 action: "c++-link-dynamic-library"
hlopkodad22762018-03-01 13:17:23 -0800443 action: "c++-link-nodeps-dynamic-library"
hlopkof322ba72017-09-08 15:17:18 +0200444 action: "c++-link-static-library"
hlopkof322ba72017-09-08 15:17:18 +0200445 env_entry {
446 key: "PATH"
447 value: "%{msvc_env_path}"
448 }
449 env_entry {
hlopkof322ba72017-09-08 15:17:18 +0200450 key: "TMP"
451 value: "%{msvc_env_tmp}"
452 }
453 env_entry {
454 key: "TEMP"
455 value: "%{msvc_env_tmp}"
456 }
457 }
Loo Rong Jiee6860a82018-07-10 00:36:19 -0700458 implies: 'msvc_compile_env'
459 implies: 'msvc_link_env'
460 }
461
462 feature {
463 name: "msvc_compile_env"
464 env_set {
465 action: "c-compile"
466 action: "c++-compile"
467 action: "c++-module-compile"
468 action: "c++-module-codegen"
469 action: "c++-header-parsing"
470 action: "assemble"
471 action: "preprocess-assemble"
472 env_entry {
473 key: "INCLUDE"
474 value: "%{msvc_env_include}"
475 }
476 }
477 }
478
479 feature {
480 name: "msvc_link_env"
481 env_set {
482 action: "c++-link-executable"
483 action: "c++-link-dynamic-library"
484 action: "c++-link-nodeps-dynamic-library"
485 action: "c++-link-static-library"
486 env_entry {
487 key: "LIB"
488 value: "%{msvc_env_lib}"
489 }
490 }
hlopkof322ba72017-09-08 15:17:18 +0200491 }
492
493 feature {
hlopkof322ba72017-09-08 15:17:18 +0200494 name: 'include_paths'
495 flag_set {
Seth Greensteinae760d22017-11-17 02:20:06 -0800496 action: "assemble"
hlopkof322ba72017-09-08 15:17:18 +0200497 action: 'preprocess-assemble'
498 action: 'c-compile'
499 action: 'c++-compile'
500 action: 'c++-header-parsing'
hlopkof322ba72017-09-08 15:17:18 +0200501 action: 'c++-module-compile'
502 flag_group {
503 iterate_over: 'quote_include_paths'
504 flag: '/I%{quote_include_paths}'
505 }
506 flag_group {
507 iterate_over: 'include_paths'
508 flag: '/I%{include_paths}'
509 }
510 flag_group {
511 iterate_over: 'system_include_paths'
512 flag: '/I%{system_include_paths}'
513 }
514 }
515 }
516
517 feature {
518 name: "preprocessor_defines"
519 flag_set {
Seth Greensteinae760d22017-11-17 02:20:06 -0800520 action: "assemble"
hlopkof322ba72017-09-08 15:17:18 +0200521 action: "preprocess-assemble"
522 action: "c-compile"
523 action: "c++-compile"
524 action: "c++-header-parsing"
hlopkof322ba72017-09-08 15:17:18 +0200525 action: "c++-module-compile"
526 flag_group {
527 flag: "/D%{preprocessor_defines}"
528 iterate_over: "preprocessor_defines"
529 }
530 }
531 }
532
533 # Tell Bazel to parse the output of /showIncludes
534 feature {
535 name: 'parse_showincludes'
536 flag_set {
hlopkof322ba72017-09-08 15:17:18 +0200537 action: 'preprocess-assemble'
538 action: 'c-compile'
539 action: 'c++-compile'
540 action: 'c++-module-compile'
hlopkof322ba72017-09-08 15:17:18 +0200541 action: 'c++-header-parsing'
542 flag_group {
543 flag: "/showIncludes"
544 }
545 }
546 }
547
548
Yun Peng81aede12016-10-25 13:49:28 +0000549 feature {
Yun Peng997992d2017-04-18 13:33:28 +0200550 name: 'generate_pdb_file'
551 requires: {
552 feature: 'dbg'
553 }
554 requires: {
555 feature: 'fastbuild'
556 }
557 }
558
559 feature {
hlopko21903f92017-04-27 17:37:31 +0200560 name: 'shared_flag'
561 flag_set {
562 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800563 action: "c++-link-nodeps-dynamic-library"
hlopko21903f92017-04-27 17:37:31 +0200564 flag_group {
565 flag: '/DLL'
566 }
567 }
Yun Peng81aede12016-10-25 13:49:28 +0000568 }
569
570 feature {
hlopko21903f92017-04-27 17:37:31 +0200571 name: 'linkstamps'
572 flag_set {
573 action: 'c++-link-executable'
574 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800575 action: "c++-link-nodeps-dynamic-library"
hlopko21903f92017-04-27 17:37:31 +0200576 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800577 expand_if_all_available: 'linkstamp_paths'
hlopkoec41b8c2017-07-04 04:31:11 -0400578 iterate_over: 'linkstamp_paths'
hlopko21903f92017-04-27 17:37:31 +0200579 flag: '%{linkstamp_paths}'
580 }
581 }
Yun Peng81aede12016-10-25 13:49:28 +0000582 }
583
584 feature {
hlopko21903f92017-04-27 17:37:31 +0200585 name: 'output_execpath_flags'
586 flag_set {
hlopko21903f92017-04-27 17:37:31 +0200587 action: 'c++-link-executable'
588 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800589 action: "c++-link-nodeps-dynamic-library"
hlopko21903f92017-04-27 17:37:31 +0200590 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800591 expand_if_all_available: 'output_execpath'
hlopko21903f92017-04-27 17:37:31 +0200592 flag: '/OUT:%{output_execpath}'
593 }
594 }
Yun Peng81aede12016-10-25 13:49:28 +0000595 }
596
597 feature {
hlopkoa4697fd2017-06-01 10:14:40 +0200598 name: 'archiver_flags'
599 flag_set {
hlopkoa4697fd2017-06-01 10:14:40 +0200600 action: 'c++-link-static-library'
hlopkoa4697fd2017-06-01 10:14:40 +0200601 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800602 expand_if_all_available: 'output_execpath'
Yun Peng284a6112017-06-06 05:32:34 -0400603 flag: '/OUT:%{output_execpath}'
hlopkoa4697fd2017-06-01 10:14:40 +0200604 }
605 }
606 }
607
608 feature {
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000609 name: 'input_param_flags'
610 flag_set {
Marcel Hlopko5374d4f2016-12-22 08:04:06 +0000611 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800612 action: "c++-link-nodeps-dynamic-library"
Marcel Hlopko5374d4f2016-12-22 08:04:06 +0000613 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800614 expand_if_all_available: 'interface_library_output_path'
Yun Peng394211b2017-09-15 15:59:14 +0200615 flag: "/IMPLIB:%{interface_library_output_path}"
Marcel Hlopko5374d4f2016-12-22 08:04:06 +0000616 }
617 }
618 flag_set {
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000619 action: 'c++-link-executable'
620 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800621 action: "c++-link-nodeps-dynamic-library"
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000622 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800623 expand_if_all_available: 'libopts'
hlopkoec41b8c2017-07-04 04:31:11 -0400624 iterate_over: 'libopts'
hlopko21903f92017-04-27 17:37:31 +0200625 flag: '%{libopts}'
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000626 }
627 }
628 flag_set {
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000629 action: 'c++-link-executable'
630 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800631 action: "c++-link-nodeps-dynamic-library"
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000632 action: 'c++-link-static-library'
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000633 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800634 expand_if_all_available: 'libraries_to_link'
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000635 iterate_over: 'libraries_to_link'
636 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000637 expand_if_equal: {
638 variable: 'libraries_to_link.type'
639 value: 'object_file_group'
640 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000641 iterate_over: 'libraries_to_link.object_files'
642 flag_group {
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000643 flag: '%{libraries_to_link.object_files}'
644 }
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000645 }
646 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000647 expand_if_equal: {
648 variable: 'libraries_to_link.type'
649 value: 'object_file'
650 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000651 flag_group {
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000652 flag: '%{libraries_to_link.name}'
653 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000654 }
655 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000656 expand_if_equal: {
657 variable: 'libraries_to_link.type'
658 value: 'interface_library'
659 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000660 flag_group {
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000661 flag: '%{libraries_to_link.name}'
662 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000663 }
664 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000665 expand_if_equal: {
666 variable: 'libraries_to_link.type'
667 value: 'static_library'
668 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000669 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000670 expand_if_false: 'libraries_to_link.is_whole_archive'
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000671 flag: '%{libraries_to_link.name}'
672 }
673 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000674 expand_if_true: 'libraries_to_link.is_whole_archive'
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000675 flag: '/WHOLEARCHIVE:%{libraries_to_link.name}'
676 }
677 }
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000678 }
679 }
Yun Peng81aede12016-10-25 13:49:28 +0000680 }
681
Laszlo Csomor1a636442017-07-20 12:38:02 +0200682 # Since this feature is declared earlier in the CROSSTOOL than
hlopko2661abb2018-05-16 22:45:06 -0700683 # "user_link_flags", this feature will be applied prior to it anwyhere they
684 # are both implied. And since "user_link_flags" contains the linkopts from
Laszlo Csomor1a636442017-07-20 12:38:02 +0200685 # the build rule, this allows the user to override the /SUBSYSTEM in the BUILD
686 # file.
687 feature {
688 name: 'linker_subsystem_flag'
689 flag_set {
690 action: 'c++-link-executable'
691 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800692 action: "c++-link-nodeps-dynamic-library"
Laszlo Csomor1a636442017-07-20 12:38:02 +0200693 flag_group {
694 flag: '/SUBSYSTEM:CONSOLE'
695 }
696 }
697 }
698
hlopko2661abb2018-05-16 22:45:06 -0700699 # The "user_link_flags" contains user-defined linkopts (from build rules)
Laszlo Csomor1a636442017-07-20 12:38:02 +0200700 # so it should be defined after features that declare user-overridable flags.
701 # For example the "linker_subsystem_flag" defines a default "/SUBSYSTEM" flag
702 # but we want to let the user override it, therefore "link_flag_subsystem" is
hlopko2661abb2018-05-16 22:45:06 -0700703 # defined earlier in the CROSSTOOL file than "user_link_flags".
704 feature {
705 name: 'user_link_flags'
706 flag_set {
hlopko2661abb2018-05-16 22:45:06 -0700707 action: 'c++-link-executable'
708 action: 'c++-link-dynamic-library'
709 action: "c++-link-nodeps-dynamic-library"
710 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800711 expand_if_all_available: 'user_link_flags'
hlopko2661abb2018-05-16 22:45:06 -0700712 iterate_over: 'user_link_flags'
713 flag: '%{user_link_flags}'
714 }
715 }
716 }
Marcel Hlopko5b630242016-12-22 08:48:05 +0000717 feature {
Marcel Hlopko75c95ac2016-12-22 16:10:54 +0000718 name: 'legacy_link_flags'
Marcel Hlopko5b630242016-12-22 08:48:05 +0000719 flag_set {
Marcel Hlopko5b630242016-12-22 08:48:05 +0000720 action: 'c++-link-executable'
721 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800722 action: "c++-link-nodeps-dynamic-library"
Marcel Hlopko5b630242016-12-22 08:48:05 +0000723 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800724 expand_if_all_available: 'legacy_link_flags'
hlopkoec41b8c2017-07-04 04:31:11 -0400725 iterate_over: 'legacy_link_flags'
Marcel Hlopko75c95ac2016-12-22 16:10:54 +0000726 flag: '%{legacy_link_flags}'
Marcel Hlopko5b630242016-12-22 08:48:05 +0000727 }
728 }
729 }
730
Marcel Hlopko46d36322017-01-24 10:39:40 +0000731 feature {
732 name: 'linker_param_file'
733 flag_set {
Marcel Hlopko46d36322017-01-24 10:39:40 +0000734 action: 'c++-link-executable'
735 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800736 action: "c++-link-nodeps-dynamic-library"
Marcel Hlopko46d36322017-01-24 10:39:40 +0000737 action: 'c++-link-static-library'
Marcel Hlopko46d36322017-01-24 10:39:40 +0000738 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800739 expand_if_all_available: 'linker_param_file'
Marcel Hlopko46d36322017-01-24 10:39:40 +0000740 flag: '@%{linker_param_file}'
741 }
742 }
743 }
744
Yun Peng997992d2017-04-18 13:33:28 +0200745 feature {
Yun Peng1edcd0f2017-09-26 10:30:44 +0200746 name: 'static_link_msvcrt'
Yun Peng3b08f772017-05-04 06:17:42 -0400747 }
748
749 feature {
Yun Peng1edcd0f2017-09-26 10:30:44 +0200750 name: 'static_link_msvcrt_no_debug'
Yun Peng3b08f772017-05-04 06:17:42 -0400751 flag_set {
752 action: 'c-compile'
753 action: 'c++-compile'
754 flag_group {
Yun Peng1edcd0f2017-09-26 10:30:44 +0200755 flag: "/MT"
Yun Peng3b08f772017-05-04 06:17:42 -0400756 }
757 }
758 flag_set {
759 action: 'c++-link-executable'
760 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800761 action: "c++-link-nodeps-dynamic-library"
Yun Peng3b08f772017-05-04 06:17:42 -0400762 flag_group {
Yun Peng1edcd0f2017-09-26 10:30:44 +0200763 flag: "/DEFAULTLIB:libcmt.lib"
Yun Peng3b08f772017-05-04 06:17:42 -0400764 }
765 }
Yun Peng1edcd0f2017-09-26 10:30:44 +0200766 requires: { feature: 'fastbuild'}
767 requires: { feature: 'opt'}
768 }
769
770 feature {
771 name: 'dynamic_link_msvcrt_no_debug'
772 flag_set {
773 action: 'c-compile'
774 action: 'c++-compile'
775 flag_group {
776 flag: "/MD"
777 }
778 }
779 flag_set {
780 action: 'c++-link-executable'
781 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800782 action: "c++-link-nodeps-dynamic-library"
Yun Peng1edcd0f2017-09-26 10:30:44 +0200783 flag_group {
784 flag: "/DEFAULTLIB:msvcrt.lib"
785 }
786 }
787 requires: { feature: 'fastbuild'}
788 requires: { feature: 'opt'}
789 }
790
791 feature {
792 name: 'static_link_msvcrt_debug'
793 flag_set {
794 action: 'c-compile'
795 action: 'c++-compile'
796 flag_group {
797 flag: "/MTd"
798 }
799 }
800 flag_set {
801 action: 'c++-link-executable'
802 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800803 action: "c++-link-nodeps-dynamic-library"
Yun Peng1edcd0f2017-09-26 10:30:44 +0200804 flag_group {
805 flag: "/DEFAULTLIB:libcmtd.lib"
806 }
807 }
808 requires: { feature: 'dbg'}
809 }
810
811 feature {
812 name: 'dynamic_link_msvcrt_debug'
813 flag_set {
814 action: 'c-compile'
815 action: 'c++-compile'
816 flag_group {
817 flag: "/MDd"
818 }
819 }
820 flag_set {
821 action: 'c++-link-executable'
822 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800823 action: "c++-link-nodeps-dynamic-library"
Yun Peng1edcd0f2017-09-26 10:30:44 +0200824 flag_group {
825 flag: "/DEFAULTLIB:msvcrtd.lib"
826 }
827 }
828 requires: { feature: 'dbg'}
Yun Peng3b08f772017-05-04 06:17:42 -0400829 }
830
831 feature {
Yun Peng997992d2017-04-18 13:33:28 +0200832 name: 'dbg'
833 flag_set {
834 action: 'c-compile'
835 action: 'c++-compile'
836 flag_group {
837 flag: "/Od"
Yun Peng997992d2017-04-18 13:33:28 +0200838 flag: "/Z7"
839 }
840 }
841 flag_set {
842 action: 'c++-link-executable'
843 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800844 action: "c++-link-nodeps-dynamic-library"
Yun Peng997992d2017-04-18 13:33:28 +0200845 flag_group {
Yun Peng09a6a9f2017-12-11 07:24:45 -0800846 flag: "%{dbg_mode_debug}"
Yun Peng997992d2017-04-18 13:33:28 +0200847 flag: "/INCREMENTAL:NO"
848 }
849 }
850 implies: 'generate_pdb_file'
851 }
852
853 feature {
854 name: 'fastbuild'
855 flag_set {
856 action: 'c-compile'
857 action: 'c++-compile'
858 flag_group {
859 flag: "/Od"
Yun Peng997992d2017-04-18 13:33:28 +0200860 flag: "/Z7"
861 }
862 }
863 flag_set {
864 action: 'c++-link-executable'
865 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800866 action: "c++-link-nodeps-dynamic-library"
Yun Peng997992d2017-04-18 13:33:28 +0200867 flag_group {
Yun Peng09a6a9f2017-12-11 07:24:45 -0800868 flag: "%{fastbuild_mode_debug}"
Yun Peng997992d2017-04-18 13:33:28 +0200869 flag: "/INCREMENTAL:NO"
870 }
871 }
872 implies: 'generate_pdb_file'
873 }
874
875 feature {
876 name: 'opt'
877 flag_set {
878 action: 'c-compile'
879 action: 'c++-compile'
880 flag_group {
Loo Rong Jieccd7d762018-07-10 09:26:49 -0700881 flag: "/O2" # Implies /Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy
882 }
883 }
884 implies: 'frame_pointer'
885 }
886
887 # Keep stack frames for debugging, even in opt mode.
888 # Must come after /O1, /O2 and /Ox.
889 feature {
890 name: "frame_pointer"
891 flag_set {
892 action: "c-compile"
893 action: "c++-compile"
894 flag_group {
895 flag: "/Oy-"
896 }
897 }
898 }
899
900 # Remove assert/DCHECKs in opt mode.
901 # You can have them back with --features=-disable_assertions.
902 feature {
903 name: 'disable_assertions'
904 enabled: true
905 flag_set {
906 action: 'c-compile'
907 action: 'c++-compile'
908 with_feature: {
909 feature: 'opt'
910 }
911 flag_group {
pcloudyebdb4ac2017-11-22 05:14:23 -0800912 flag: "/DNDEBUG"
Yun Peng997992d2017-04-18 13:33:28 +0200913 }
914 }
915 }
916
hlopko646cfd82017-08-01 22:26:37 +0200917 feature {
Loo Rong Jieccd7d762018-07-10 09:26:49 -0700918 name: "determinism"
919 enabled: true
920 flag_set {
921 action: "c-compile"
922 action: "c++-compile"
923 flag_group {
924 # Make C++ compilation deterministic. Use linkstamping instead of these
925 # compiler symbols.
926 # TODO: detect clang on Windows and use "-Wno-builtin-macro-redefined"
Loo Rong Jiee0542bc2018-08-03 01:49:37 -0700927 flag: "/wd4117" # Trying to define or undefine a predefined macro
Loo Rong Jieccd7d762018-07-10 09:26:49 -0700928 flag: "-D__DATE__=\"redacted\""
929 flag: "-D__TIMESTAMP__=\"redacted\""
930 flag: "-D__TIME__=\"redacted\""
931 }
932 }
933 }
934
935 feature {
936 name: 'treat_warnings_as_errors'
937 flag_set {
938 action: 'c-compile'
939 action: 'c++-compile'
940 flag_group {
941 flag: "/WX"
942 }
943 }
944 }
945
946 # Trade slower build time for smaller binary
947 feature {
948 name: 'smaller_binary'
949 enabled: true
950 flag_set {
951 action: 'c-compile'
952 action: 'c++-compile'
953 with_feature: {
954 feature: 'opt'
955 }
956 flag_group {
957 flag: "/Gy" # Enable function-level linking (-ffunction-sections)
958 flag: "/Gw" # Optimize global data (-fdata-sections)
959 }
960 }
961 flag_set {
962 action: 'c++-link-executable'
963 action: 'c++-link-dynamic-library',
964 action: 'c++-link-nodeps-dynamic-library'
965 with_feature: {
966 feature: 'opt'
967 }
968 flag_group {
969 flag: '/OPT:ICF' # Fold identical functions
970 flag: '/OPT:REF' # Eliminate unreferenced functions and data
971 }
972 }
973 }
974
975 # Suppress warnings that most users do not care
976 feature {
977 name: 'ignore_noisy_warnings'
978 enabled: true
979 flag_set {
980 action: 'c++-link-static-library'
981 flag_group {
982 # Suppress 'object file does not define any public symbols' warning
983 flag: '/ignore:4221'
984 }
985 }
986 }
987
988 feature {
hlopkof322ba72017-09-08 15:17:18 +0200989 name: 'user_compile_flags'
hlopko646cfd82017-08-01 22:26:37 +0200990 flag_set {
hlopko646cfd82017-08-01 22:26:37 +0200991 action: 'preprocess-assemble'
992 action: 'c-compile'
993 action: 'c++-compile'
994 action: 'c++-header-parsing'
hlopko646cfd82017-08-01 22:26:37 +0200995 action: 'c++-module-compile'
996 action: 'c++-module-codegen'
997 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800998 expand_if_all_available: 'user_compile_flags'
hlopkof322ba72017-09-08 15:17:18 +0200999 iterate_over: 'user_compile_flags'
1000 flag: '%{user_compile_flags}'
hlopko646cfd82017-08-01 22:26:37 +02001001 }
1002 }
1003 }
1004
hlopkof322ba72017-09-08 15:17:18 +02001005 feature {
hlopkob05bff62017-09-12 10:51:44 +02001006 name: 'sysroot'
1007 flag_set {
hlopkob05bff62017-09-12 10:51:44 +02001008 action: 'assemble'
1009 action: 'preprocess-assemble'
1010 action: 'c-compile'
1011 action: 'c++-compile'
1012 action: 'c++-header-parsing'
hlopkob05bff62017-09-12 10:51:44 +02001013 action: 'c++-module-compile'
1014 action: 'c++-module-codegen'
1015 action: 'c++-link-executable'
1016 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -08001017 action: "c++-link-nodeps-dynamic-library"
hlopkob05bff62017-09-12 10:51:44 +02001018 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -08001019 expand_if_all_available: 'sysroot'
hlopkob05bff62017-09-12 10:51:44 +02001020 iterate_over: 'sysroot'
1021 flag: '--sysroot=%{sysroot}'
1022 }
1023 }
1024 }
1025
1026 feature {
hlopkof322ba72017-09-08 15:17:18 +02001027 name: 'unfiltered_compile_flags'
1028 flag_set {
hlopkof322ba72017-09-08 15:17:18 +02001029 action: 'preprocess-assemble'
1030 action: 'c-compile'
1031 action: 'c++-compile'
1032 action: 'c++-header-parsing'
hlopkof322ba72017-09-08 15:17:18 +02001033 action: 'c++-module-compile'
1034 action: 'c++-module-codegen'
1035 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -08001036 expand_if_all_available: 'unfiltered_compile_flags'
hlopkof322ba72017-09-08 15:17:18 +02001037 iterate_over: 'unfiltered_compile_flags'
1038 flag: '%{unfiltered_compile_flags}'
1039 }
1040 }
1041 }
1042
Yun Peng394211b2017-09-15 15:59:14 +02001043 feature {
hlopko6f1a2ec2018-05-16 12:32:32 -07001044 name: 'compiler_output_flags'
1045 flag_set {
1046 action: 'assemble'
1047 flag_group {
1048 expand_if_all_available: 'output_file'
1049 expand_if_none_available: 'output_assembly_file'
1050 expand_if_none_available: 'output_preprocess_file'
1051 flag: '/Fo%{output_file}'
1052 flag: '/Zi'
1053 }
1054 }
1055 flag_set {
1056 action: 'preprocess-assemble'
1057 action: 'c-compile'
1058 action: 'c++-compile'
1059 action: 'c++-header-parsing'
hlopko6f1a2ec2018-05-16 12:32:32 -07001060 action: 'c++-module-compile'
1061 action: 'c++-module-codegen'
1062 flag_group {
1063 expand_if_all_available: 'output_file'
1064 expand_if_none_available: 'output_assembly_file'
1065 expand_if_none_available: 'output_preprocess_file'
1066 flag: '/Fo%{output_file}'
1067 }
1068 flag_group {
1069 expand_if_all_available: 'output_file'
1070 expand_if_all_available: 'output_assembly_file'
1071 flag: '/Fa%{output_file}'
1072 }
1073 flag_group {
1074 expand_if_all_available: 'output_file'
1075 expand_if_all_available: 'output_preprocess_file'
1076 flag: '/P'
1077 flag: '/Fi%{output_file}'
1078 }
1079 }
1080 }
1081
1082 feature {
1083 name: 'compiler_input_flags'
1084 flag_set {
1085 action: 'assemble'
1086 action: 'preprocess-assemble'
1087 action: 'c-compile'
1088 action: 'c++-compile'
1089 action: 'c++-header-parsing'
hlopko6f1a2ec2018-05-16 12:32:32 -07001090 action: 'c++-module-compile'
1091 action: 'c++-module-codegen'
1092 flag_group {
1093 expand_if_all_available: 'source_file'
1094 flag: '/c'
1095 flag: '%{source_file}'
1096 }
1097 }
1098 }
1099
1100 feature {
Yun Peng9cc954a2017-11-14 01:45:02 -08001101 name : 'def_file',
Yun Peng394211b2017-09-15 15:59:14 +02001102 flag_set {
Yun Peng394211b2017-09-15 15:59:14 +02001103 action: 'c++-link-executable'
1104 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -08001105 action: "c++-link-nodeps-dynamic-library"
Yun Peng394211b2017-09-15 15:59:14 +02001106 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -08001107 expand_if_all_available: 'def_file_path'
Yun Peng394211b2017-09-15 15:59:14 +02001108 flag: "/DEF:%{def_file_path}"
1109 # We can specify a different DLL name in DEF file, /ignore:4070 suppresses
1110 # the warning message about DLL name doesn't match the default one.
1111 # See https://msdn.microsoft.com/en-us/library/sfkk2fz7.aspx
1112 flag: "/ignore:4070"
1113 }
1114 }
1115 }
1116
1117 feature {
Yun Peng9cc954a2017-11-14 01:45:02 -08001118 name: 'windows_export_all_symbols'
1119 }
1120
1121 feature {
Yun Peng394211b2017-09-15 15:59:14 +02001122 name: 'no_windows_export_all_symbols'
1123 }
1124
1125 linking_mode_flags { mode: DYNAMIC }
Lukacs Berki76a2bbc2016-08-22 14:53:38 +00001126}