blob: 57895e5621d55fc38d63a6afd0b29994645069fe [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: ""
17default_target_cpu: "same_as_host"
18
19default_toolchain {
20 cpu: "%{cpu}"
Yun Pengc77eac92017-03-08 13:54:06 +000021 toolchain_identifier: "%{default_toolchain_name}"
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +000022}
23
24default_toolchain {
25 cpu: "armeabi-v7a"
26 toolchain_identifier: "stub_armeabi-v7a"
27}
28
Yun Peng56b16e72016-07-12 10:55:57 +000029default_toolchain {
Yun Peng1f614722017-10-16 19:26:06 +020030 cpu: "x64_windows"
31 toolchain_identifier: "msvc_x64"
32}
33
34default_toolchain {
Yun Peng56b16e72016-07-12 10:55:57 +000035 cpu: "x64_windows_msvc"
Yun Pengc77eac92017-03-08 13:54:06 +000036 toolchain_identifier: "msvc_x64"
37}
38
39default_toolchain {
40 cpu: "x64_windows_msys"
41 toolchain_identifier: "msys_x64"
Yun Peng56b16e72016-07-12 10:55:57 +000042}
43
namrata-ibm155bd642016-10-11 09:59:27 +000044default_toolchain {
45 cpu: "s390x"
Nicolas Lopezbcbdb872017-03-28 08:08:50 +000046 toolchain_identifier: "%{toolchain_name}"
namrata-ibm155bd642016-10-11 09:59:27 +000047}
48
Cal Peyserf026e142016-12-19 18:16:26 +000049default_toolchain {
50 cpu: "ios_x86_64"
51 toolchain_identifier: "ios_x86_64"
52}
53
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +000054# Android tooling requires a default toolchain for the armeabi-v7a cpu.
55toolchain {
56 abi_version: "armeabi-v7a"
57 abi_libc_version: "armeabi-v7a"
58 builtin_sysroot: ""
59 compiler: "compiler"
60 host_system_name: "armeabi-v7a"
61 needsPic: true
62 supports_gold_linker: false
63 supports_incremental_linker: false
64 supports_fission: false
65 supports_interface_shared_objects: false
66 supports_normalizing_ar: false
67 supports_start_end_lib: false
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +000068 target_libc: "armeabi-v7a"
69 target_cpu: "armeabi-v7a"
70 target_system_name: "armeabi-v7a"
71 toolchain_identifier: "stub_armeabi-v7a"
72
73 tool_path { name: "ar" path: "/bin/false" }
74 tool_path { name: "compat-ld" path: "/bin/false" }
75 tool_path { name: "cpp" path: "/bin/false" }
76 tool_path { name: "dwp" path: "/bin/false" }
77 tool_path { name: "gcc" path: "/bin/false" }
78 tool_path { name: "gcov" path: "/bin/false" }
79 tool_path { name: "ld" path: "/bin/false" }
80
81 tool_path { name: "nm" path: "/bin/false" }
82 tool_path { name: "objcopy" path: "/bin/false" }
83 tool_path { name: "objdump" path: "/bin/false" }
84 tool_path { name: "strip" path: "/bin/false" }
85 linking_mode_flags { mode: DYNAMIC }
86}
87
88toolchain {
Cal Peyserf026e142016-12-19 18:16:26 +000089 toolchain_identifier: "ios_x86_64"
90 host_system_name: "x86_64-apple-macosx"
91 target_system_name: "x86_64-apple-ios"
92 target_cpu: "ios_x86_64"
93 target_libc: "ios"
94 compiler: "compiler"
95 abi_version: "local"
96 abi_libc_version: "local"
97 supports_gold_linker: false
98 supports_incremental_linker: false
99 supports_fission: false
100 supports_interface_shared_objects: false
101 supports_normalizing_ar: false
102 supports_start_end_lib: false
103
104 tool_path { name: "ar" path: "/bin/false" }
105 tool_path { name: "compat-ld" path: "/bin/false" }
106 tool_path { name: "cpp" path: "/bin/false" }
107 tool_path { name: "dwp" path: "/bin/false" }
108 tool_path { name: "gcc" path: "/bin/false" }
109 tool_path { name: "gcov" path: "/bin/false" }
110 tool_path { name: "ld" path: "/bin/false" }
111
112 tool_path { name: "nm" path: "/bin/false" }
113 tool_path { name: "objcopy" path: "/bin/false" }
114 tool_path { name: "objdump" path: "/bin/false" }
115 tool_path { name: "strip" path: "/bin/false" }
116 linking_mode_flags { mode: DYNAMIC }
117}
118
119toolchain {
Yun Pengc77eac92017-03-08 13:54:06 +0000120 toolchain_identifier: "%{toolchain_name}"
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +0000121%{content}
122
123 compilation_mode_flags {
124 mode: DBG
125%{dbg_content}
126 }
127 compilation_mode_flags {
128 mode: OPT
129%{opt_content}
130 }
131 linking_mode_flags { mode: DYNAMIC }
Marcel Hlopko71c72c12017-02-23 14:10:31 +0000132
133%{coverage}
Benjamin Petersonb9e1c8a2017-12-05 06:27:26 -0800134
135 feature {
136 name: 'fdo_optimize'
137 provides: 'profile'
138 flag_set {
139 action: 'c-compile'
140 action: 'c++-compile'
141 expand_if_all_available: 'fdo_profile_path'
142 flag_group {
143 flag: '-fprofile-use=%{fdo_profile_path}'
144 flag: '-fprofile-correction',
145 }
146 }
147 }
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +0000148}
Yun Peng56b16e72016-07-12 10:55:57 +0000149
150toolchain {
Yun Penge9f40902018-01-03 09:20:27 -0800151 toolchain_identifier: "msys_x64_mingw"
152 abi_version: "local"
153 abi_libc_version: "local"
154 builtin_sysroot: ""
155 compiler: "mingw-gcc"
156 host_system_name: "local"
157 needsPic: false
158 target_libc: "mingw"
159 target_cpu: "x64_windows"
160 target_system_name: "local"
161
162%{msys_x64_mingw_content}
163
164 linking_mode_flags { mode: DYNAMIC }
165}
166
167toolchain {
Yun Pengc77eac92017-03-08 13:54:06 +0000168 toolchain_identifier: "msvc_x64"
Yun Peng56b16e72016-07-12 10:55:57 +0000169 host_system_name: "local"
170 target_system_name: "local"
171
172 abi_version: "local"
173 abi_libc_version: "local"
Yun Pengc77eac92017-03-08 13:54:06 +0000174 target_cpu: "x64_windows"
Yun Penge9f40902018-01-03 09:20:27 -0800175 compiler: "msvc-cl"
176 target_libc: "msvcrt"
Yun Peng56b16e72016-07-12 10:55:57 +0000177 default_python_version: "python2.7"
178
179%{cxx_builtin_include_directory}
180
181 tool_path {
182 name: "ar"
Yun Peng284a6112017-06-06 05:32:34 -0400183 path: "%{msvc_lib_path}"
Yun Peng56b16e72016-07-12 10:55:57 +0000184 }
185 tool_path {
Seth Greensteinae760d22017-11-17 02:20:06 -0800186 name: "ml"
187 path: "%{msvc_ml_path}"
188 }
189 tool_path {
Yun Peng56b16e72016-07-12 10:55:57 +0000190 name: "cpp"
Yun Peng284a6112017-06-06 05:32:34 -0400191 path: "%{msvc_cl_path}"
Yun Peng56b16e72016-07-12 10:55:57 +0000192 }
193 tool_path {
194 name: "gcc"
Yun Peng284a6112017-06-06 05:32:34 -0400195 path: "%{msvc_cl_path}"
Yun Peng56b16e72016-07-12 10:55:57 +0000196 }
197 tool_path {
198 name: "gcov"
199 path: "wrapper/bin/msvc_nop.bat"
200 }
201 tool_path {
202 name: "ld"
Yun Peng284a6112017-06-06 05:32:34 -0400203 path: "%{msvc_link_path}"
Yun Peng56b16e72016-07-12 10:55:57 +0000204 }
205 tool_path {
206 name: "nm"
207 path: "wrapper/bin/msvc_nop.bat"
208 }
209 tool_path {
210 name: "objcopy"
211 path: "wrapper/bin/msvc_nop.bat"
212 }
213 tool_path {
214 name: "objdump"
215 path: "wrapper/bin/msvc_nop.bat"
216 }
217 tool_path {
218 name: "strip"
219 path: "wrapper/bin/msvc_nop.bat"
220 }
221 supports_gold_linker: false
Yun Peng56b16e72016-07-12 10:55:57 +0000222 supports_start_end_lib: false
Yun Peng394211b2017-09-15 15:59:14 +0200223 supports_interface_shared_objects: true
Yun Peng56b16e72016-07-12 10:55:57 +0000224 supports_incremental_linker: false
225 supports_normalizing_ar: true
226 needsPic: false
227
Yun Peng56b16e72016-07-12 10:55:57 +0000228 # TODO(pcloudy): Review those flags below, they should be defined by cl.exe
Yun Peng56b16e72016-07-12 10:55:57 +0000229 compiler_flag: "/DCOMPILER_MSVC"
230
pcloudyb9554c12017-07-10 14:09:16 +0200231 # Don't define min/max macros in windows.h.
232 compiler_flag: "/DNOMINMAX"
233
Yun Peng56b16e72016-07-12 10:55:57 +0000234 # Platform defines.
235 compiler_flag: "/D_WIN32_WINNT=0x0600"
236 # Turn off warning messages.
237 compiler_flag: "/D_CRT_SECURE_NO_DEPRECATE"
238 compiler_flag: "/D_CRT_SECURE_NO_WARNINGS"
239 compiler_flag: "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS"
Yun Peng56b16e72016-07-12 10:55:57 +0000240
241 # Useful options to have on for compilation.
Yun Peng56b16e72016-07-12 10:55:57 +0000242 # Increase the capacity of object files to 2^32 sections.
243 compiler_flag: "/bigobj"
244 # Allocate 500MB for precomputed headers.
245 compiler_flag: "/Zm500"
246 # Use unsigned char by default.
247 compiler_flag: "/J"
248 # Use function level linking.
249 compiler_flag: "/Gy"
250 # Use string pooling.
251 compiler_flag: "/GF"
Yun Peng56b16e72016-07-12 10:55:57 +0000252 # Catch both asynchronous (structured) and synchronous (C++) exceptions.
253 compiler_flag: "/EHsc"
254
255 # Globally disabled warnings.
256 # Don't warn about elements of array being be default initialized.
257 compiler_flag: "/wd4351"
258 # Don't warn about no matching delete found.
259 compiler_flag: "/wd4291"
260 # Don't warn about diamond inheritance patterns.
261 compiler_flag: "/wd4250"
262 # Don't warn about insecure functions (e.g. non _s functions).
263 compiler_flag: "/wd4996"
264
Yun Pengf3fd3a42017-04-24 13:37:46 +0200265 linker_flag: "/MACHINE:X64"
266
hlopko26e5a472017-07-05 14:06:39 -0400267 feature {
268 name: "no_legacy_features"
269 }
270
Yun Pengf3fd3a42017-04-24 13:37:46 +0200271 # Suppress startup banner.
272 feature {
273 name: "nologo"
274 flag_set {
275 action: "c-compile"
276 action: "c++-compile"
277 action: "c++-module-compile"
278 action: "c++-module-codegen"
279 action: "c++-header-parsing"
280 action: "c++-header-preprocessing"
281 action: "assemble"
282 action: "preprocess-assemble"
283 action: "c++-link-executable"
284 action: "c++-link-dynamic-library"
hlopkodad22762018-03-01 13:17:23 -0800285 action: "c++-link-nodeps-dynamic-library"
Yun Pengf3fd3a42017-04-24 13:37:46 +0200286 action: "c++-link-static-library"
287 action: "c++-link-alwayslink-static-library"
288 action: "c++-link-pic-static-library"
289 action: "c++-link-alwayslink-pic-static-library"
290 flag_group {
291 flag: "/nologo"
292 }
293 }
294 }
Yun Peng56b16e72016-07-12 10:55:57 +0000295
Yun Peng394211b2017-09-15 15:59:14 +0200296 feature {
297 name: 'has_configured_linker_path'
298 }
299
Yun Peng02866942017-08-04 10:45:46 +0200300 # This feature indicates strip is not supported, building stripped binary will just result a copy of orignial binary
301 feature {
302 name: 'no_stripping'
303 }
304
Yun Peng394211b2017-09-15 15:59:14 +0200305 # This feature indicates this is a toolchain targeting Windows.
306 feature {
307 name: 'targets_windows'
Yun Peng481657d2017-09-20 10:25:48 +0200308 implies: 'copy_dynamic_libraries_to_binary'
Yun Peng394211b2017-09-15 15:59:14 +0200309 enabled: true
310 }
311
Yun Peng481657d2017-09-20 10:25:48 +0200312 feature {
313 name: 'copy_dynamic_libraries_to_binary'
314 }
315
Yun Peng56b16e72016-07-12 10:55:57 +0000316 action_config {
Seth Greensteinae760d22017-11-17 02:20:06 -0800317 config_name: 'assemble'
318 action_name: 'assemble'
319 tool {
320 tool_path: '%{msvc_ml_path}'
321 }
322 flag_set {
323 expand_if_all_available: 'output_object_file'
324 flag_group {
325 flag: '/Fo%{output_object_file}'
326 flag: '/Zi'
327 flag: '/c'
328 flag: '%{source_file}'
329 }
330 }
331 implies: 'nologo'
332 implies: 'msvc_env'
333 implies: 'sysroot'
334 }
335
336 action_config {
Yun Peng56b16e72016-07-12 10:55:57 +0000337 config_name: 'c-compile'
338 action_name: 'c-compile'
339 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400340 tool_path: '%{msvc_cl_path}'
Yun Peng56b16e72016-07-12 10:55:57 +0000341 }
342 flag_set {
343 flag_group {
344 flag: '/c'
345 flag: '%{source_file}'
346 }
347 }
348 flag_set {
349 expand_if_all_available: 'output_object_file'
350 flag_group {
351 flag: '/Fo%{output_object_file}'
352 }
353 }
354 flag_set {
355 expand_if_all_available: 'output_assembly_file'
356 flag_group {
357 flag: '/Fa%{output_assembly_file}'
358 }
359 }
360 flag_set {
361 expand_if_all_available: 'output_preprocess_file'
362 flag_group {
363 flag: '/P'
364 flag: '/Fi%{output_preprocess_file}'
365 }
366 }
hlopkof322ba72017-09-08 15:17:18 +0200367 implies: 'legacy_compile_flags'
Yun Pengf3fd3a42017-04-24 13:37:46 +0200368 implies: 'nologo'
Yun Peng6a0ddd82017-04-05 13:52:28 +0000369 implies: 'msvc_env'
Yun Peng29d5e9c2017-04-25 14:21:41 +0200370 implies: 'parse_showincludes'
hlopkof322ba72017-09-08 15:17:18 +0200371 implies: 'user_compile_flags'
hlopkob05bff62017-09-12 10:51:44 +0200372 implies: 'sysroot'
hlopkof322ba72017-09-08 15:17:18 +0200373 implies: 'unfiltered_compile_flags'
Yun Peng56b16e72016-07-12 10:55:57 +0000374 }
375
376 action_config {
377 config_name: 'c++-compile'
378 action_name: 'c++-compile'
379 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400380 tool_path: '%{msvc_cl_path}'
Yun Peng56b16e72016-07-12 10:55:57 +0000381 }
382 flag_set {
383 flag_group {
384 flag: '/c'
385 flag: '%{source_file}'
386 }
387 }
388 flag_set {
389 expand_if_all_available: 'output_object_file'
390 flag_group {
391 flag: '/Fo%{output_object_file}'
392 }
393 }
394 flag_set {
395 expand_if_all_available: 'output_assembly_file'
396 flag_group {
397 flag: '/Fa%{output_assembly_file}'
398 }
399 }
400 flag_set {
401 expand_if_all_available: 'output_preprocess_file'
402 flag_group {
403 flag: '/P'
404 flag: '/Fi%{output_preprocess_file}'
405 }
406 }
hlopkof322ba72017-09-08 15:17:18 +0200407 implies: 'legacy_compile_flags'
Yun Pengf3fd3a42017-04-24 13:37:46 +0200408 implies: 'nologo'
Yun Peng6a0ddd82017-04-05 13:52:28 +0000409 implies: 'msvc_env'
Yun Peng29d5e9c2017-04-25 14:21:41 +0200410 implies: 'parse_showincludes'
hlopkof322ba72017-09-08 15:17:18 +0200411 implies: 'user_compile_flags'
hlopkob05bff62017-09-12 10:51:44 +0200412 implies: 'sysroot'
hlopkof322ba72017-09-08 15:17:18 +0200413 implies: 'unfiltered_compile_flags'
Yun Peng56b16e72016-07-12 10:55:57 +0000414 }
415
Yun Peng81aede12016-10-25 13:49:28 +0000416 action_config {
hlopko21903f92017-04-27 17:37:31 +0200417 config_name: 'c++-link-executable'
418 action_name: 'c++-link-executable'
419 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400420 tool_path: '%{msvc_link_path}'
hlopko21903f92017-04-27 17:37:31 +0200421 }
422 implies: 'nologo'
hlopko21903f92017-04-27 17:37:31 +0200423 implies: 'linkstamps'
424 implies: 'output_execpath_flags'
425 implies: 'input_param_flags'
426 implies: 'legacy_link_flags'
Laszlo Csomor1a636442017-07-20 12:38:02 +0200427 implies: 'linker_subsystem_flag'
hlopko21903f92017-04-27 17:37:31 +0200428 implies: 'linker_param_file'
429 implies: 'msvc_env'
Yun Peng284a6112017-06-06 05:32:34 -0400430 implies: 'use_linker'
Yun Peng02866942017-08-04 10:45:46 +0200431 implies: 'no_stripping'
Yun Peng81aede12016-10-25 13:49:28 +0000432 }
433
434 action_config {
hlopko21903f92017-04-27 17:37:31 +0200435 config_name: 'c++-link-dynamic-library'
436 action_name: 'c++-link-dynamic-library'
437 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400438 tool_path: '%{msvc_link_path}'
hlopko21903f92017-04-27 17:37:31 +0200439 }
440 implies: 'nologo'
hlopko21903f92017-04-27 17:37:31 +0200441 implies: 'shared_flag'
442 implies: 'linkstamps'
443 implies: 'output_execpath_flags'
444 implies: 'input_param_flags'
hlopko21903f92017-04-27 17:37:31 +0200445 implies: 'legacy_link_flags'
Laszlo Csomor1a636442017-07-20 12:38:02 +0200446 implies: 'linker_subsystem_flag'
hlopko21903f92017-04-27 17:37:31 +0200447 implies: 'linker_param_file'
448 implies: 'msvc_env'
Yun Peng284a6112017-06-06 05:32:34 -0400449 implies: 'use_linker'
Yun Peng02866942017-08-04 10:45:46 +0200450 implies: 'no_stripping'
Yun Peng394211b2017-09-15 15:59:14 +0200451 implies: 'has_configured_linker_path'
Yun Peng9cc954a2017-11-14 01:45:02 -0800452 implies: 'def_file'
Yun Peng81aede12016-10-25 13:49:28 +0000453 }
454
455 action_config {
hlopkodad22762018-03-01 13:17:23 -0800456 config_name: 'c++-link-nodeps-dynamic-library'
457 action_name: 'c++-link-nodeps-dynamic-library'
458 tool {
459 tool_path: '%{msvc_link_path}'
460 }
461 implies: 'nologo'
462 implies: 'shared_flag'
463 implies: 'linkstamps'
464 implies: 'output_execpath_flags'
465 implies: 'input_param_flags'
466 implies: 'legacy_link_flags'
467 implies: 'linker_subsystem_flag'
468 implies: 'linker_param_file'
469 implies: 'msvc_env'
470 implies: 'use_linker'
471 implies: 'no_stripping'
472 implies: 'has_configured_linker_path'
473 implies: 'def_file'
474 }
475
476 action_config {
hlopko21903f92017-04-27 17:37:31 +0200477 config_name: 'c++-link-static-library'
478 action_name: 'c++-link-static-library'
479 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400480 tool_path: '%{msvc_lib_path}'
hlopko21903f92017-04-27 17:37:31 +0200481 }
482 implies: 'nologo'
hlopkoa4697fd2017-06-01 10:14:40 +0200483 implies: 'archiver_flags'
hlopko21903f92017-04-27 17:37:31 +0200484 implies: 'input_param_flags'
485 implies: 'linker_param_file'
486 implies: 'msvc_env'
Yun Peng81aede12016-10-25 13:49:28 +0000487 }
488
489 action_config {
hlopko21903f92017-04-27 17:37:31 +0200490 config_name: 'c++-link-alwayslink-static-library'
491 action_name: 'c++-link-alwayslink-static-library'
492 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400493 tool_path: '%{msvc_lib_path}'
hlopko21903f92017-04-27 17:37:31 +0200494 }
495 implies: 'nologo'
hlopkoa4697fd2017-06-01 10:14:40 +0200496 implies: 'archiver_flags'
hlopko21903f92017-04-27 17:37:31 +0200497 implies: 'input_param_flags'
498 implies: 'linker_param_file'
499 implies: 'msvc_env'
Yun Peng81aede12016-10-25 13:49:28 +0000500 }
501
502 # TODO(pcloudy): The following action_config is listed in MANDATORY_LINK_TARGET_TYPES.
503 # But do we really need them on Windows?
504 action_config {
hlopko21903f92017-04-27 17:37:31 +0200505 config_name: 'c++-link-pic-static-library'
506 action_name: 'c++-link-pic-static-library'
507 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400508 tool_path: '%{msvc_lib_path}'
hlopko21903f92017-04-27 17:37:31 +0200509 }
510 implies: 'nologo'
hlopkoa4697fd2017-06-01 10:14:40 +0200511 implies: 'archiver_flags'
hlopko21903f92017-04-27 17:37:31 +0200512 implies: 'input_param_flags'
513 implies: 'linker_param_file'
514 implies: 'msvc_env'
Yun Peng81aede12016-10-25 13:49:28 +0000515 }
516
517 action_config {
hlopko21903f92017-04-27 17:37:31 +0200518 config_name: 'c++-link-alwayslink-pic-static-library'
519 action_name: 'c++-link-alwayslink-pic-static-library'
520 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400521 tool_path: '%{msvc_lib_path}'
hlopko21903f92017-04-27 17:37:31 +0200522 }
523 implies: 'nologo'
hlopkoa4697fd2017-06-01 10:14:40 +0200524 implies: 'archiver_flags'
hlopko21903f92017-04-27 17:37:31 +0200525 implies: 'input_param_flags'
526 implies: 'linker_param_file'
527 implies: 'msvc_env'
Yun Peng81aede12016-10-25 13:49:28 +0000528 }
529
530 action_config {
531 config_name: 'c++-link-interface-dynamic-library'
532 action_name: 'c++-link-interface-dynamic-library'
533 tool {
Yun Peng284a6112017-06-06 05:32:34 -0400534 tool_path: '%{msvc_lib_path}'
Yun Peng81aede12016-10-25 13:49:28 +0000535 }
Yun Pengf3fd3a42017-04-24 13:37:46 +0200536 implies: 'nologo'
Marcel Hlopko46d36322017-01-24 10:39:40 +0000537 implies: 'linker_param_file'
Yun Peng6a0ddd82017-04-05 13:52:28 +0000538 implies: 'msvc_env'
Yun Peng81aede12016-10-25 13:49:28 +0000539 }
540
hlopkof322ba72017-09-08 15:17:18 +0200541 # TODO(b/65151735): Remove legacy_compile_flags feature when legacy fields are
542 # not used in this crosstool
543 feature {
544 name: 'legacy_compile_flags'
545 flag_set {
546 expand_if_all_available: 'legacy_compile_flags'
hlopkof322ba72017-09-08 15:17:18 +0200547 action: 'preprocess-assemble'
548 action: 'c-compile'
549 action: 'c++-compile'
550 action: 'c++-header-parsing'
551 action: 'c++-header-preprocessing'
552 action: 'c++-module-compile'
553 action: 'c++-module-codegen'
554 flag_group {
555 iterate_over: 'legacy_compile_flags'
556 flag: '%{legacy_compile_flags}'
557 }
558 }
559 }
560
561 feature {
562 name: "msvc_env"
563 env_set {
564 action: "c-compile"
565 action: "c++-compile"
566 action: "c++-module-compile"
567 action: "c++-module-codegen"
568 action: "c++-header-parsing"
569 action: "c++-header-preprocessing"
570 action: "assemble"
571 action: "preprocess-assemble"
572 action: "c++-link-executable"
573 action: "c++-link-dynamic-library"
hlopkodad22762018-03-01 13:17:23 -0800574 action: "c++-link-nodeps-dynamic-library"
hlopkof322ba72017-09-08 15:17:18 +0200575 action: "c++-link-static-library"
576 action: "c++-link-alwayslink-static-library"
577 action: "c++-link-pic-static-library"
578 action: "c++-link-alwayslink-pic-static-library"
579 env_entry {
580 key: "PATH"
581 value: "%{msvc_env_path}"
582 }
583 env_entry {
584 key: "INCLUDE"
585 value: "%{msvc_env_include}"
586 }
587 env_entry {
588 key: "LIB"
589 value: "%{msvc_env_lib}"
590 }
591 env_entry {
592 key: "TMP"
593 value: "%{msvc_env_tmp}"
594 }
595 env_entry {
596 key: "TEMP"
597 value: "%{msvc_env_tmp}"
598 }
599 }
600 }
601
602 feature {
603 name: "use_linker"
604 env_set {
605 action: "c++-link-executable"
606 action: "c++-link-dynamic-library"
hlopkodad22762018-03-01 13:17:23 -0800607 action: "c++-link-nodeps-dynamic-library"
hlopkof322ba72017-09-08 15:17:18 +0200608 env_entry {
609 key: "USE_LINKER"
610 value: "1"
611 }
612 }
613 }
614
615 feature {
616 name: 'include_paths'
617 flag_set {
Seth Greensteinae760d22017-11-17 02:20:06 -0800618 action: "assemble"
hlopkof322ba72017-09-08 15:17:18 +0200619 action: 'preprocess-assemble'
620 action: 'c-compile'
621 action: 'c++-compile'
622 action: 'c++-header-parsing'
623 action: 'c++-header-preprocessing'
624 action: 'c++-module-compile'
625 flag_group {
626 iterate_over: 'quote_include_paths'
627 flag: '/I%{quote_include_paths}'
628 }
629 flag_group {
630 iterate_over: 'include_paths'
631 flag: '/I%{include_paths}'
632 }
633 flag_group {
634 iterate_over: 'system_include_paths'
635 flag: '/I%{system_include_paths}'
636 }
637 }
638 }
639
640 feature {
641 name: "preprocessor_defines"
642 flag_set {
Seth Greensteinae760d22017-11-17 02:20:06 -0800643 action: "assemble"
hlopkof322ba72017-09-08 15:17:18 +0200644 action: "preprocess-assemble"
645 action: "c-compile"
646 action: "c++-compile"
647 action: "c++-header-parsing"
648 action: "c++-header-preprocessing"
649 action: "c++-module-compile"
650 flag_group {
651 flag: "/D%{preprocessor_defines}"
652 iterate_over: "preprocessor_defines"
653 }
654 }
655 }
656
657 # Tell Bazel to parse the output of /showIncludes
658 feature {
659 name: 'parse_showincludes'
660 flag_set {
hlopkof322ba72017-09-08 15:17:18 +0200661 action: 'preprocess-assemble'
662 action: 'c-compile'
663 action: 'c++-compile'
664 action: 'c++-module-compile'
665 action: 'c++-header-preprocessing'
666 action: 'c++-header-parsing'
667 flag_group {
668 flag: "/showIncludes"
669 }
670 }
671 }
672
673
Yun Peng81aede12016-10-25 13:49:28 +0000674 feature {
Yun Peng997992d2017-04-18 13:33:28 +0200675 name: 'generate_pdb_file'
676 requires: {
677 feature: 'dbg'
678 }
679 requires: {
680 feature: 'fastbuild'
681 }
682 }
683
684 feature {
hlopko21903f92017-04-27 17:37:31 +0200685 name: 'shared_flag'
686 flag_set {
687 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800688 action: "c++-link-nodeps-dynamic-library"
hlopko21903f92017-04-27 17:37:31 +0200689 flag_group {
690 flag: '/DLL'
691 }
692 }
Yun Peng81aede12016-10-25 13:49:28 +0000693 }
694
695 feature {
hlopko21903f92017-04-27 17:37:31 +0200696 name: 'linkstamps'
697 flag_set {
698 action: 'c++-link-executable'
699 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800700 action: "c++-link-nodeps-dynamic-library"
hlopko21903f92017-04-27 17:37:31 +0200701 expand_if_all_available: 'linkstamp_paths'
702 flag_group {
hlopkoec41b8c2017-07-04 04:31:11 -0400703 iterate_over: 'linkstamp_paths'
hlopko21903f92017-04-27 17:37:31 +0200704 flag: '%{linkstamp_paths}'
705 }
706 }
Yun Peng81aede12016-10-25 13:49:28 +0000707 }
708
709 feature {
hlopko21903f92017-04-27 17:37:31 +0200710 name: 'output_execpath_flags'
711 flag_set {
712 expand_if_all_available: 'output_execpath'
713 action: 'c++-link-executable'
714 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800715 action: "c++-link-nodeps-dynamic-library"
hlopko21903f92017-04-27 17:37:31 +0200716 flag_group {
717 flag: '/OUT:%{output_execpath}'
718 }
719 }
Yun Peng81aede12016-10-25 13:49:28 +0000720 }
721
722 feature {
hlopkoa4697fd2017-06-01 10:14:40 +0200723 name: 'archiver_flags'
724 flag_set {
725 expand_if_all_available: 'output_execpath'
726 action: 'c++-link-static-library'
727 action: 'c++-link-alwayslink-static-library'
728 action: 'c++-link-pic-static-library'
729 action: 'c++-link-alwayslink-pic-static-library'
730 flag_group {
Yun Peng284a6112017-06-06 05:32:34 -0400731 flag: '/OUT:%{output_execpath}'
hlopkoa4697fd2017-06-01 10:14:40 +0200732 }
733 }
734 }
735
736 feature {
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000737 name: 'input_param_flags'
738 flag_set {
Yun Peng394211b2017-09-15 15:59:14 +0200739 expand_if_all_available: 'interface_library_output_path'
Marcel Hlopko5374d4f2016-12-22 08:04:06 +0000740 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800741 action: "c++-link-nodeps-dynamic-library"
Marcel Hlopko5374d4f2016-12-22 08:04:06 +0000742 flag_group {
Yun Peng394211b2017-09-15 15:59:14 +0200743 flag: "/IMPLIB:%{interface_library_output_path}"
Marcel Hlopko5374d4f2016-12-22 08:04:06 +0000744 }
745 }
746 flag_set {
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000747 expand_if_all_available: 'libopts'
748 action: 'c++-link-executable'
749 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800750 action: "c++-link-nodeps-dynamic-library"
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000751 flag_group {
hlopkoec41b8c2017-07-04 04:31:11 -0400752 iterate_over: 'libopts'
hlopko21903f92017-04-27 17:37:31 +0200753 flag: '%{libopts}'
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000754 }
755 }
756 flag_set {
757 expand_if_all_available: 'libraries_to_link'
758 action: 'c++-link-executable'
759 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800760 action: "c++-link-nodeps-dynamic-library"
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000761 action: 'c++-link-static-library'
762 action: 'c++-link-alwayslink-static-library'
763 action: 'c++-link-pic-static-library'
764 action: 'c++-link-alwayslink-pic-static-library'
765 flag_group {
766 iterate_over: 'libraries_to_link'
767 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000768 expand_if_equal: {
769 variable: 'libraries_to_link.type'
770 value: 'object_file_group'
771 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000772 iterate_over: 'libraries_to_link.object_files'
773 flag_group {
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000774 flag: '%{libraries_to_link.object_files}'
775 }
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000776 }
777 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000778 expand_if_equal: {
779 variable: 'libraries_to_link.type'
780 value: 'object_file'
781 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000782 flag_group {
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000783 flag: '%{libraries_to_link.name}'
784 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000785 }
786 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000787 expand_if_equal: {
788 variable: 'libraries_to_link.type'
789 value: 'interface_library'
790 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000791 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000792 expand_if_false: 'libraries_to_link.is_whole_archive'
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000793 flag: '%{libraries_to_link.name}'
794 }
795 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000796 expand_if_true: 'libraries_to_link.is_whole_archive'
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000797 flag: '/WHOLEARCHIVE:%{libraries_to_link.name}'
798 }
799 }
800 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000801 expand_if_equal: {
802 variable: 'libraries_to_link.type'
803 value: 'static_library'
804 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000805 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000806 expand_if_false: 'libraries_to_link.is_whole_archive'
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000807 flag: '%{libraries_to_link.name}'
808 }
809 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000810 expand_if_true: 'libraries_to_link.is_whole_archive'
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000811 flag: '/WHOLEARCHIVE:%{libraries_to_link.name}'
812 }
813 }
814 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000815 expand_if_equal: {
816 variable: 'libraries_to_link.type'
817 value: 'dynamic_library'
818 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000819 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000820 expand_if_false: 'libraries_to_link.is_whole_archive'
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000821 flag: '%{libraries_to_link.name}'
822 }
823 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000824 expand_if_true: 'libraries_to_link.is_whole_archive'
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000825 flag: '/WHOLEARCHIVE:%{libraries_to_link.name}'
826 }
827 }
828 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000829 expand_if_equal: {
830 variable: 'libraries_to_link.type'
831 value: 'versioned_dynamic_library'
832 }
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000833 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000834 expand_if_false: 'libraries_to_link.is_whole_archive'
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000835 flag: '%{libraries_to_link.name}'
836 }
837 flag_group {
Marcel Hlopko1410c212017-02-27 11:24:36 +0000838 expand_if_true: 'libraries_to_link.is_whole_archive'
Marcel Hlopkof63ea7a2017-01-23 12:34:38 +0000839 flag: '/WHOLEARCHIVE:%{libraries_to_link.name}'
840 }
Marcel Hlopko0ca9d7e2016-12-09 15:32:56 +0000841 }
842 }
843 }
Yun Peng81aede12016-10-25 13:49:28 +0000844 }
845
Laszlo Csomor1a636442017-07-20 12:38:02 +0200846 # Since this feature is declared earlier in the CROSSTOOL than
847 # "legacy_link_flags", this feature will be applied prior to it anwyhere they
848 # are both implied. And since "legacy_link_flags" contains the linkopts from
849 # the build rule, this allows the user to override the /SUBSYSTEM in the BUILD
850 # file.
851 feature {
852 name: 'linker_subsystem_flag'
853 flag_set {
854 action: 'c++-link-executable'
855 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800856 action: "c++-link-nodeps-dynamic-library"
Laszlo Csomor1a636442017-07-20 12:38:02 +0200857 flag_group {
858 flag: '/SUBSYSTEM:CONSOLE'
859 }
860 }
861 }
862
863 # The "legacy_link_flags" may contain user-defined linkopts (from build rules)
864 # so it should be defined after features that declare user-overridable flags.
865 # For example the "linker_subsystem_flag" defines a default "/SUBSYSTEM" flag
866 # but we want to let the user override it, therefore "link_flag_subsystem" is
867 # defined earlier in the CROSSTOOL file than "legacy_link_flags".
Marcel Hlopko5b630242016-12-22 08:48:05 +0000868 feature {
Marcel Hlopko75c95ac2016-12-22 16:10:54 +0000869 name: 'legacy_link_flags'
Marcel Hlopko5b630242016-12-22 08:48:05 +0000870 flag_set {
Marcel Hlopko75c95ac2016-12-22 16:10:54 +0000871 expand_if_all_available: 'legacy_link_flags'
Marcel Hlopko5b630242016-12-22 08:48:05 +0000872 action: 'c++-link-executable'
873 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800874 action: "c++-link-nodeps-dynamic-library"
Marcel Hlopko5b630242016-12-22 08:48:05 +0000875 flag_group {
hlopkoec41b8c2017-07-04 04:31:11 -0400876 iterate_over: 'legacy_link_flags'
Marcel Hlopko75c95ac2016-12-22 16:10:54 +0000877 flag: '%{legacy_link_flags}'
Marcel Hlopko5b630242016-12-22 08:48:05 +0000878 }
879 }
880 }
881
Marcel Hlopko46d36322017-01-24 10:39:40 +0000882 feature {
883 name: 'linker_param_file'
884 flag_set {
885 expand_if_all_available: 'linker_param_file'
886 action: 'c++-link-executable'
887 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800888 action: "c++-link-nodeps-dynamic-library"
Marcel Hlopko46d36322017-01-24 10:39:40 +0000889 action: 'c++-link-static-library'
890 action: 'c++-link-alwayslink-static-library'
891 action: 'c++-link-pic-static-library'
892 action: 'c++-link-alwayslink-pic-static-library'
893 flag_group {
894 flag: '@%{linker_param_file}'
895 }
896 }
897 }
898
Yun Peng997992d2017-04-18 13:33:28 +0200899 feature {
Yun Peng1edcd0f2017-09-26 10:30:44 +0200900 name: 'static_link_msvcrt'
Yun Peng3b08f772017-05-04 06:17:42 -0400901 }
902
903 feature {
Yun Peng1edcd0f2017-09-26 10:30:44 +0200904 name: 'static_link_msvcrt_no_debug'
Yun Peng3b08f772017-05-04 06:17:42 -0400905 flag_set {
906 action: 'c-compile'
907 action: 'c++-compile'
908 flag_group {
Yun Peng1edcd0f2017-09-26 10:30:44 +0200909 flag: "/MT"
Yun Peng3b08f772017-05-04 06:17:42 -0400910 }
911 }
912 flag_set {
913 action: 'c++-link-executable'
914 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800915 action: "c++-link-nodeps-dynamic-library"
Yun Peng3b08f772017-05-04 06:17:42 -0400916 flag_group {
Yun Peng1edcd0f2017-09-26 10:30:44 +0200917 flag: "/DEFAULTLIB:libcmt.lib"
Yun Peng3b08f772017-05-04 06:17:42 -0400918 }
919 }
Yun Peng1edcd0f2017-09-26 10:30:44 +0200920 requires: { feature: 'fastbuild'}
921 requires: { feature: 'opt'}
922 }
923
924 feature {
925 name: 'dynamic_link_msvcrt_no_debug'
926 flag_set {
927 action: 'c-compile'
928 action: 'c++-compile'
929 flag_group {
930 flag: "/MD"
931 }
932 }
933 flag_set {
934 action: 'c++-link-executable'
935 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800936 action: "c++-link-nodeps-dynamic-library"
Yun Peng1edcd0f2017-09-26 10:30:44 +0200937 flag_group {
938 flag: "/DEFAULTLIB:msvcrt.lib"
939 }
940 }
941 requires: { feature: 'fastbuild'}
942 requires: { feature: 'opt'}
943 }
944
945 feature {
946 name: 'static_link_msvcrt_debug'
947 flag_set {
948 action: 'c-compile'
949 action: 'c++-compile'
950 flag_group {
951 flag: "/MTd"
952 }
953 }
954 flag_set {
955 action: 'c++-link-executable'
956 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800957 action: "c++-link-nodeps-dynamic-library"
Yun Peng1edcd0f2017-09-26 10:30:44 +0200958 flag_group {
959 flag: "/DEFAULTLIB:libcmtd.lib"
960 }
961 }
962 requires: { feature: 'dbg'}
963 }
964
965 feature {
966 name: 'dynamic_link_msvcrt_debug'
967 flag_set {
968 action: 'c-compile'
969 action: 'c++-compile'
970 flag_group {
971 flag: "/MDd"
972 }
973 }
974 flag_set {
975 action: 'c++-link-executable'
976 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800977 action: "c++-link-nodeps-dynamic-library"
Yun Peng1edcd0f2017-09-26 10:30:44 +0200978 flag_group {
979 flag: "/DEFAULTLIB:msvcrtd.lib"
980 }
981 }
982 requires: { feature: 'dbg'}
Yun Peng3b08f772017-05-04 06:17:42 -0400983 }
984
985 feature {
Yun Peng997992d2017-04-18 13:33:28 +0200986 name: 'dbg'
987 flag_set {
988 action: 'c-compile'
989 action: 'c++-compile'
990 flag_group {
991 flag: "/Od"
Yun Peng997992d2017-04-18 13:33:28 +0200992 flag: "/Z7"
pcloudy7585dcd2017-11-22 06:05:30 -0800993 flag: "/DDEBUG"
Yun Peng997992d2017-04-18 13:33:28 +0200994 }
995 }
996 flag_set {
997 action: 'c++-link-executable'
998 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800999 action: "c++-link-nodeps-dynamic-library"
Yun Peng997992d2017-04-18 13:33:28 +02001000 flag_group {
Yun Peng09a6a9f2017-12-11 07:24:45 -08001001 flag: "%{dbg_mode_debug}"
Yun Peng997992d2017-04-18 13:33:28 +02001002 flag: "/INCREMENTAL:NO"
1003 }
1004 }
1005 implies: 'generate_pdb_file'
1006 }
1007
1008 feature {
1009 name: 'fastbuild'
1010 flag_set {
1011 action: 'c-compile'
1012 action: 'c++-compile'
1013 flag_group {
1014 flag: "/Od"
Yun Peng997992d2017-04-18 13:33:28 +02001015 flag: "/Z7"
pcloudy7585dcd2017-11-22 06:05:30 -08001016 flag: "/DDEBUG"
Yun Peng997992d2017-04-18 13:33:28 +02001017 }
1018 }
1019 flag_set {
1020 action: 'c++-link-executable'
1021 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -08001022 action: "c++-link-nodeps-dynamic-library"
Yun Peng997992d2017-04-18 13:33:28 +02001023 flag_group {
Yun Peng09a6a9f2017-12-11 07:24:45 -08001024 flag: "%{fastbuild_mode_debug}"
Yun Peng997992d2017-04-18 13:33:28 +02001025 flag: "/INCREMENTAL:NO"
1026 }
1027 }
1028 implies: 'generate_pdb_file'
1029 }
1030
1031 feature {
1032 name: 'opt'
1033 flag_set {
1034 action: 'c-compile'
1035 action: 'c++-compile'
1036 flag_group {
1037 flag: "/O2"
pcloudyebdb4ac2017-11-22 05:14:23 -08001038 flag: "/DNDEBUG"
Yun Peng997992d2017-04-18 13:33:28 +02001039 }
1040 }
1041 }
1042
hlopko646cfd82017-08-01 22:26:37 +02001043 feature {
hlopkof322ba72017-09-08 15:17:18 +02001044 name: 'user_compile_flags'
hlopko646cfd82017-08-01 22:26:37 +02001045 flag_set {
hlopkof322ba72017-09-08 15:17:18 +02001046 expand_if_all_available: 'user_compile_flags'
hlopko646cfd82017-08-01 22:26:37 +02001047 action: 'preprocess-assemble'
1048 action: 'c-compile'
1049 action: 'c++-compile'
1050 action: 'c++-header-parsing'
1051 action: 'c++-header-preprocessing'
1052 action: 'c++-module-compile'
1053 action: 'c++-module-codegen'
1054 flag_group {
hlopkof322ba72017-09-08 15:17:18 +02001055 iterate_over: 'user_compile_flags'
1056 flag: '%{user_compile_flags}'
hlopko646cfd82017-08-01 22:26:37 +02001057 }
1058 }
1059 }
1060
hlopkof322ba72017-09-08 15:17:18 +02001061 feature {
hlopkob05bff62017-09-12 10:51:44 +02001062 name: 'sysroot'
1063 flag_set {
1064 expand_if_all_available: 'sysroot'
1065 action: 'assemble'
1066 action: 'preprocess-assemble'
1067 action: 'c-compile'
1068 action: 'c++-compile'
1069 action: 'c++-header-parsing'
1070 action: 'c++-header-preprocessing'
1071 action: 'c++-module-compile'
1072 action: 'c++-module-codegen'
1073 action: 'c++-link-executable'
1074 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -08001075 action: "c++-link-nodeps-dynamic-library"
hlopkob05bff62017-09-12 10:51:44 +02001076 flag_group {
1077 iterate_over: 'sysroot'
1078 flag: '--sysroot=%{sysroot}'
1079 }
1080 }
1081 }
1082
1083 feature {
hlopkof322ba72017-09-08 15:17:18 +02001084 name: 'unfiltered_compile_flags'
1085 flag_set {
1086 expand_if_all_available: 'unfiltered_compile_flags'
hlopkof322ba72017-09-08 15:17:18 +02001087 action: 'preprocess-assemble'
1088 action: 'c-compile'
1089 action: 'c++-compile'
1090 action: 'c++-header-parsing'
1091 action: 'c++-header-preprocessing'
1092 action: 'c++-module-compile'
1093 action: 'c++-module-codegen'
1094 flag_group {
1095 iterate_over: 'unfiltered_compile_flags'
1096 flag: '%{unfiltered_compile_flags}'
1097 }
1098 }
1099 }
1100
Yun Peng394211b2017-09-15 15:59:14 +02001101 feature {
Yun Peng9cc954a2017-11-14 01:45:02 -08001102 name : 'def_file',
Yun Peng394211b2017-09-15 15:59:14 +02001103 flag_set {
1104 expand_if_all_available: 'def_file_path'
1105 action: 'c++-link-executable'
1106 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -08001107 action: "c++-link-nodeps-dynamic-library"
Yun Peng394211b2017-09-15 15:59:14 +02001108 flag_group {
1109 flag: "/DEF:%{def_file_path}"
1110 # We can specify a different DLL name in DEF file, /ignore:4070 suppresses
1111 # the warning message about DLL name doesn't match the default one.
1112 # See https://msdn.microsoft.com/en-us/library/sfkk2fz7.aspx
1113 flag: "/ignore:4070"
1114 }
1115 }
1116 }
1117
1118 feature {
Yun Peng9cc954a2017-11-14 01:45:02 -08001119 name: 'windows_export_all_symbols'
1120 }
1121
1122 feature {
Yun Peng394211b2017-09-15 15:59:14 +02001123 name: 'no_windows_export_all_symbols'
1124 }
1125
1126 linking_mode_flags { mode: DYNAMIC }
hlopkof322ba72017-09-08 15:17:18 +02001127
Yun Peng284a6112017-06-06 05:32:34 -04001128%{compilation_mode_content}
Yun Peng997992d2017-04-18 13:33:28 +02001129
Lukacs Berki76a2bbc2016-08-22 14:53:38 +00001130}