Damien Martin-Guillerez | 8fa5ae6 | 2016-03-02 16:24:13 +0000 | [diff] [blame] | 1 | major_version: "local" |
| 2 | minor_version: "" |
| 3 | default_target_cpu: "same_as_host" |
| 4 | |
| 5 | default_toolchain { |
| 6 | cpu: "%{cpu}" |
| 7 | toolchain_identifier: "local" |
| 8 | } |
| 9 | |
| 10 | default_toolchain { |
| 11 | cpu: "armeabi-v7a" |
| 12 | toolchain_identifier: "stub_armeabi-v7a" |
| 13 | } |
| 14 | |
Yun Peng | 56b16e7 | 2016-07-12 10:55:57 +0000 | [diff] [blame] | 15 | default_toolchain { |
| 16 | cpu: "x64_windows_msvc" |
| 17 | toolchain_identifier: "vc_14_0_x64" |
| 18 | } |
| 19 | |
namrata-ibm | 155bd64 | 2016-10-11 09:59:27 +0000 | [diff] [blame] | 20 | default_toolchain { |
| 21 | cpu: "s390x" |
| 22 | toolchain_identifier: "local" |
| 23 | } |
| 24 | |
Cal Peyser | f026e14 | 2016-12-19 18:16:26 +0000 | [diff] [blame] | 25 | default_toolchain { |
| 26 | cpu: "ios_x86_64" |
| 27 | toolchain_identifier: "ios_x86_64" |
| 28 | } |
| 29 | |
Damien Martin-Guillerez | 8fa5ae6 | 2016-03-02 16:24:13 +0000 | [diff] [blame] | 30 | # Android tooling requires a default toolchain for the armeabi-v7a cpu. |
| 31 | toolchain { |
| 32 | abi_version: "armeabi-v7a" |
| 33 | abi_libc_version: "armeabi-v7a" |
| 34 | builtin_sysroot: "" |
| 35 | compiler: "compiler" |
| 36 | host_system_name: "armeabi-v7a" |
| 37 | needsPic: true |
| 38 | supports_gold_linker: false |
| 39 | supports_incremental_linker: false |
| 40 | supports_fission: false |
| 41 | supports_interface_shared_objects: false |
| 42 | supports_normalizing_ar: false |
| 43 | supports_start_end_lib: false |
Damien Martin-Guillerez | 8fa5ae6 | 2016-03-02 16:24:13 +0000 | [diff] [blame] | 44 | target_libc: "armeabi-v7a" |
| 45 | target_cpu: "armeabi-v7a" |
| 46 | target_system_name: "armeabi-v7a" |
| 47 | toolchain_identifier: "stub_armeabi-v7a" |
| 48 | |
| 49 | tool_path { name: "ar" path: "/bin/false" } |
| 50 | tool_path { name: "compat-ld" path: "/bin/false" } |
| 51 | tool_path { name: "cpp" path: "/bin/false" } |
| 52 | tool_path { name: "dwp" path: "/bin/false" } |
| 53 | tool_path { name: "gcc" path: "/bin/false" } |
| 54 | tool_path { name: "gcov" path: "/bin/false" } |
| 55 | tool_path { name: "ld" path: "/bin/false" } |
| 56 | |
| 57 | tool_path { name: "nm" path: "/bin/false" } |
| 58 | tool_path { name: "objcopy" path: "/bin/false" } |
| 59 | tool_path { name: "objdump" path: "/bin/false" } |
| 60 | tool_path { name: "strip" path: "/bin/false" } |
| 61 | linking_mode_flags { mode: DYNAMIC } |
| 62 | } |
| 63 | |
| 64 | toolchain { |
Cal Peyser | f026e14 | 2016-12-19 18:16:26 +0000 | [diff] [blame] | 65 | toolchain_identifier: "ios_x86_64" |
| 66 | host_system_name: "x86_64-apple-macosx" |
| 67 | target_system_name: "x86_64-apple-ios" |
| 68 | target_cpu: "ios_x86_64" |
| 69 | target_libc: "ios" |
| 70 | compiler: "compiler" |
| 71 | abi_version: "local" |
| 72 | abi_libc_version: "local" |
| 73 | supports_gold_linker: false |
| 74 | supports_incremental_linker: false |
| 75 | supports_fission: false |
| 76 | supports_interface_shared_objects: false |
| 77 | supports_normalizing_ar: false |
| 78 | supports_start_end_lib: false |
| 79 | |
| 80 | tool_path { name: "ar" path: "/bin/false" } |
| 81 | tool_path { name: "compat-ld" path: "/bin/false" } |
| 82 | tool_path { name: "cpp" path: "/bin/false" } |
| 83 | tool_path { name: "dwp" path: "/bin/false" } |
| 84 | tool_path { name: "gcc" path: "/bin/false" } |
| 85 | tool_path { name: "gcov" path: "/bin/false" } |
| 86 | tool_path { name: "ld" path: "/bin/false" } |
| 87 | |
| 88 | tool_path { name: "nm" path: "/bin/false" } |
| 89 | tool_path { name: "objcopy" path: "/bin/false" } |
| 90 | tool_path { name: "objdump" path: "/bin/false" } |
| 91 | tool_path { name: "strip" path: "/bin/false" } |
| 92 | linking_mode_flags { mode: DYNAMIC } |
| 93 | } |
| 94 | |
| 95 | toolchain { |
Damien Martin-Guillerez | 8fa5ae6 | 2016-03-02 16:24:13 +0000 | [diff] [blame] | 96 | toolchain_identifier: "local" |
| 97 | %{content} |
| 98 | |
| 99 | compilation_mode_flags { |
| 100 | mode: DBG |
| 101 | %{dbg_content} |
| 102 | } |
| 103 | compilation_mode_flags { |
| 104 | mode: OPT |
| 105 | %{opt_content} |
| 106 | } |
| 107 | linking_mode_flags { mode: DYNAMIC } |
| 108 | } |
Yun Peng | 56b16e7 | 2016-07-12 10:55:57 +0000 | [diff] [blame] | 109 | |
| 110 | toolchain { |
| 111 | toolchain_identifier: "vc_14_0_x64" |
| 112 | host_system_name: "local" |
| 113 | target_system_name: "local" |
| 114 | |
| 115 | abi_version: "local" |
| 116 | abi_libc_version: "local" |
| 117 | target_cpu: "x64_windows_msvc" |
| 118 | compiler: "cl" |
| 119 | target_libc: "msvcrt140" |
| 120 | default_python_version: "python2.7" |
| 121 | |
| 122 | %{cxx_builtin_include_directory} |
| 123 | |
| 124 | tool_path { |
| 125 | name: "ar" |
| 126 | path: "wrapper/bin/msvc_link.bat" |
| 127 | } |
| 128 | tool_path { |
| 129 | name: "cpp" |
| 130 | path: "wrapper/bin/msvc_cl.bat" |
| 131 | } |
| 132 | tool_path { |
| 133 | name: "gcc" |
| 134 | path: "wrapper/bin/msvc_cl.bat" |
| 135 | } |
| 136 | tool_path { |
| 137 | name: "gcov" |
| 138 | path: "wrapper/bin/msvc_nop.bat" |
| 139 | } |
| 140 | tool_path { |
| 141 | name: "ld" |
| 142 | path: "wrapper/bin/msvc_link.bat" |
| 143 | } |
| 144 | tool_path { |
| 145 | name: "nm" |
| 146 | path: "wrapper/bin/msvc_nop.bat" |
| 147 | } |
| 148 | tool_path { |
| 149 | name: "objcopy" |
| 150 | path: "wrapper/bin/msvc_nop.bat" |
| 151 | } |
| 152 | tool_path { |
| 153 | name: "objdump" |
| 154 | path: "wrapper/bin/msvc_nop.bat" |
| 155 | } |
| 156 | tool_path { |
| 157 | name: "strip" |
| 158 | path: "wrapper/bin/msvc_nop.bat" |
| 159 | } |
| 160 | supports_gold_linker: false |
Yun Peng | 56b16e7 | 2016-07-12 10:55:57 +0000 | [diff] [blame] | 161 | supports_start_end_lib: false |
| 162 | supports_interface_shared_objects: false |
| 163 | supports_incremental_linker: false |
| 164 | supports_normalizing_ar: true |
| 165 | needsPic: false |
| 166 | |
| 167 | compiler_flag: "-m64" |
| 168 | compiler_flag: "/D__inline__=__inline" |
| 169 | # TODO(pcloudy): Review those flags below, they should be defined by cl.exe |
| 170 | compiler_flag: "/DOS_WINDOWS=OS_WINDOWS" |
| 171 | compiler_flag: "/DCOMPILER_MSVC" |
| 172 | |
| 173 | # Don't pollute with GDI macros in windows.h. |
| 174 | compiler_flag: "/DNOGDI" |
| 175 | # Don't define min/max macros in windows.h. |
| 176 | compiler_flag: "/DNOMINMAX" |
| 177 | compiler_flag: "/DPRAGMA_SUPPORTED" |
| 178 | # Platform defines. |
| 179 | compiler_flag: "/D_WIN32_WINNT=0x0600" |
| 180 | # Turn off warning messages. |
| 181 | compiler_flag: "/D_CRT_SECURE_NO_DEPRECATE" |
| 182 | compiler_flag: "/D_CRT_SECURE_NO_WARNINGS" |
| 183 | compiler_flag: "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS" |
| 184 | # Use math constants (M_PI, etc.) from the math library |
| 185 | compiler_flag: "/D_USE_MATH_DEFINES" |
| 186 | |
| 187 | # Useful options to have on for compilation. |
| 188 | # Suppress startup banner. |
| 189 | compiler_flag: "/nologo" |
| 190 | # Increase the capacity of object files to 2^32 sections. |
| 191 | compiler_flag: "/bigobj" |
| 192 | # Allocate 500MB for precomputed headers. |
| 193 | compiler_flag: "/Zm500" |
| 194 | # Use unsigned char by default. |
| 195 | compiler_flag: "/J" |
| 196 | # Use function level linking. |
| 197 | compiler_flag: "/Gy" |
| 198 | # Use string pooling. |
| 199 | compiler_flag: "/GF" |
| 200 | # Warning level 3 (could possibly go to 4 in the future). |
| 201 | compiler_flag: "/W3" |
| 202 | # Catch both asynchronous (structured) and synchronous (C++) exceptions. |
| 203 | compiler_flag: "/EHsc" |
| 204 | |
| 205 | # Globally disabled warnings. |
| 206 | # Don't warn about elements of array being be default initialized. |
| 207 | compiler_flag: "/wd4351" |
| 208 | # Don't warn about no matching delete found. |
| 209 | compiler_flag: "/wd4291" |
| 210 | # Don't warn about diamond inheritance patterns. |
| 211 | compiler_flag: "/wd4250" |
| 212 | # Don't warn about insecure functions (e.g. non _s functions). |
| 213 | compiler_flag: "/wd4996" |
| 214 | |
| 215 | linker_flag: "-m64" |
| 216 | |
| 217 | feature { |
| 218 | name: 'include_paths' |
| 219 | flag_set { |
| 220 | action: 'preprocess-assemble' |
| 221 | action: 'c-compile' |
| 222 | action: 'c++-compile' |
| 223 | action: 'c++-header-parsing' |
| 224 | action: 'c++-header-preprocessing' |
| 225 | action: 'c++-module-compile' |
| 226 | flag_group { |
| 227 | flag: '/I%{quote_include_paths}' |
| 228 | } |
| 229 | flag_group { |
| 230 | flag: '/I%{include_paths}' |
| 231 | } |
| 232 | flag_group { |
| 233 | flag: '/I%{system_include_paths}' |
| 234 | } |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | feature { |
| 239 | name: 'dependency_file' |
| 240 | flag_set { |
| 241 | action: 'assemble' |
| 242 | action: 'preprocess-assemble' |
| 243 | action: 'c-compile' |
| 244 | action: 'c++-compile' |
| 245 | action: 'c++-module-compile' |
| 246 | action: 'c++-header-preprocessing' |
| 247 | action: 'c++-header-parsing' |
| 248 | expand_if_all_available: 'dependency_file' |
| 249 | flag_group { |
| 250 | flag: '/DEPENDENCY_FILE' |
| 251 | flag: '%{dependency_file}' |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | # Stop passing -frandom-seed option |
| 257 | feature { |
| 258 | name: 'random_seed' |
| 259 | } |
| 260 | |
| 261 | # This feature is just for enabling flag_set in action_config for -c and -o options during the transitional period |
| 262 | feature { |
| 263 | name: 'compile_action_flags_in_flag_set' |
| 264 | } |
| 265 | |
| 266 | action_config { |
| 267 | config_name: 'c-compile' |
| 268 | action_name: 'c-compile' |
| 269 | tool { |
| 270 | tool_path: 'wrapper/bin/msvc_cl.bat' |
| 271 | } |
| 272 | flag_set { |
| 273 | flag_group { |
| 274 | flag: '/c' |
| 275 | flag: '%{source_file}' |
| 276 | } |
| 277 | } |
| 278 | flag_set { |
| 279 | expand_if_all_available: 'output_object_file' |
| 280 | flag_group { |
| 281 | flag: '/Fo%{output_object_file}' |
| 282 | } |
| 283 | } |
| 284 | flag_set { |
| 285 | expand_if_all_available: 'output_assembly_file' |
| 286 | flag_group { |
| 287 | flag: '/Fa%{output_assembly_file}' |
| 288 | } |
| 289 | } |
| 290 | flag_set { |
| 291 | expand_if_all_available: 'output_preprocess_file' |
| 292 | flag_group { |
| 293 | flag: '/P' |
| 294 | flag: '/Fi%{output_preprocess_file}' |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | action_config { |
| 300 | config_name: 'c++-compile' |
| 301 | action_name: 'c++-compile' |
| 302 | tool { |
| 303 | tool_path: 'wrapper/bin/msvc_cl.bat' |
| 304 | } |
| 305 | flag_set { |
| 306 | flag_group { |
| 307 | flag: '/c' |
| 308 | flag: '%{source_file}' |
| 309 | } |
| 310 | } |
| 311 | flag_set { |
| 312 | expand_if_all_available: 'output_object_file' |
| 313 | flag_group { |
| 314 | flag: '/Fo%{output_object_file}' |
| 315 | } |
| 316 | } |
| 317 | flag_set { |
| 318 | expand_if_all_available: 'output_assembly_file' |
| 319 | flag_group { |
| 320 | flag: '/Fa%{output_assembly_file}' |
| 321 | } |
| 322 | } |
| 323 | flag_set { |
| 324 | expand_if_all_available: 'output_preprocess_file' |
| 325 | flag_group { |
| 326 | flag: '/P' |
| 327 | flag: '/Fi%{output_preprocess_file}' |
| 328 | } |
| 329 | } |
| 330 | } |
| 331 | |
Yun Peng | 81aede1 | 2016-10-25 13:49:28 +0000 | [diff] [blame] | 332 | action_config { |
| 333 | config_name: 'c++-link-executable' |
| 334 | action_name: 'c++-link-executable' |
| 335 | tool { |
| 336 | tool_path: 'wrapper/bin/msvc_link.bat' |
| 337 | } |
| 338 | implies: 'linkstamps' |
| 339 | implies: 'output_execpath_flags' |
| 340 | implies: 'input_param_flags' |
Yun Peng | 81aede1 | 2016-10-25 13:49:28 +0000 | [diff] [blame] | 341 | } |
| 342 | |
| 343 | action_config { |
| 344 | config_name: 'c++-link-dynamic-library' |
| 345 | action_name: 'c++-link-dynamic-library' |
| 346 | tool { |
| 347 | tool_path: 'wrapper/bin/msvc_link.bat' |
| 348 | } |
| 349 | implies: 'shared_flag' |
| 350 | implies: 'linkstamps' |
| 351 | implies: 'output_execpath_flags' |
| 352 | implies: 'input_param_flags' |
Yun Peng | 81aede1 | 2016-10-25 13:49:28 +0000 | [diff] [blame] | 353 | implies: 'has_configured_linker_path' |
| 354 | } |
| 355 | |
| 356 | action_config { |
| 357 | config_name: 'c++-link-static-library' |
| 358 | action_name: 'c++-link-static-library' |
| 359 | tool { |
| 360 | tool_path: 'wrapper/bin/msvc_link.bat' |
| 361 | } |
| 362 | implies: 'input_param_flags' |
Yun Peng | 81aede1 | 2016-10-25 13:49:28 +0000 | [diff] [blame] | 363 | } |
| 364 | |
| 365 | action_config { |
| 366 | config_name: 'c++-link-alwayslink-static-library' |
| 367 | action_name: 'c++-link-alwayslink-static-library' |
| 368 | tool { |
| 369 | tool_path: 'wrapper/bin/msvc_link.bat' |
| 370 | } |
| 371 | implies: 'input_param_flags' |
Yun Peng | 81aede1 | 2016-10-25 13:49:28 +0000 | [diff] [blame] | 372 | } |
| 373 | |
| 374 | # TODO(pcloudy): The following action_config is listed in MANDATORY_LINK_TARGET_TYPES. |
| 375 | # But do we really need them on Windows? |
| 376 | action_config { |
| 377 | config_name: 'c++-link-pic-static-library' |
| 378 | action_name: 'c++-link-pic-static-library' |
| 379 | tool { |
| 380 | tool_path: 'wrapper/bin/msvc_link.bat' |
| 381 | } |
| 382 | implies: 'input_param_flags' |
Yun Peng | 81aede1 | 2016-10-25 13:49:28 +0000 | [diff] [blame] | 383 | } |
| 384 | |
| 385 | action_config { |
| 386 | config_name: 'c++-link-alwayslink-pic-static-library' |
| 387 | action_name: 'c++-link-alwayslink-pic-static-library' |
| 388 | tool { |
| 389 | tool_path: 'wrapper/bin/msvc_link.bat' |
| 390 | } |
| 391 | implies: 'input_param_flags' |
Yun Peng | 81aede1 | 2016-10-25 13:49:28 +0000 | [diff] [blame] | 392 | } |
| 393 | |
| 394 | action_config { |
| 395 | config_name: 'c++-link-interface-dynamic-library' |
| 396 | action_name: 'c++-link-interface-dynamic-library' |
| 397 | tool { |
| 398 | tool_path: 'wrapper/bin/msvc_link.bat' |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | feature { |
| 403 | name: 'has_configured_linker_path' |
| 404 | } |
| 405 | |
| 406 | feature { |
| 407 | name: 'shared_flag' |
| 408 | flag_set { |
| 409 | action: 'c++-link-dynamic-library' |
| 410 | flag_group { |
| 411 | flag: '/DLL' |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | feature { |
| 417 | name: 'linkstamps' |
| 418 | flag_set { |
| 419 | action: 'c++-link-executable' |
| 420 | action: 'c++-link-dynamic-library' |
| 421 | expand_if_all_available: 'linkstamp_paths' |
| 422 | flag_group { |
| 423 | flag: '%{linkstamp_paths}' |
| 424 | } |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | feature { |
| 429 | name: 'output_execpath_flags' |
| 430 | flag_set { |
| 431 | expand_if_all_available: 'output_execpath' |
| 432 | action: 'c++-link-executable' |
| 433 | action: 'c++-link-dynamic-library' |
| 434 | flag_group { |
| 435 | flag: '/OUT:%{output_execpath}' |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | feature { |
Marcel Hlopko | 0ca9d7e | 2016-12-09 15:32:56 +0000 | [diff] [blame] | 441 | name: 'input_param_flags' |
| 442 | flag_set { |
| 443 | expand_if_all_available: 'libopts' |
| 444 | action: 'c++-link-executable' |
| 445 | action: 'c++-link-dynamic-library' |
| 446 | action: 'c++-link-static-library' |
| 447 | action: 'c++-link-alwayslink-static-library' |
| 448 | action: 'c++-link-pic-static-library' |
| 449 | action: 'c++-link-alwayslink-pic-static-library' |
| 450 | flag_group { |
| 451 | flag: '%{libopts}' |
| 452 | } |
| 453 | } |
| 454 | flag_set { |
| 455 | expand_if_all_available: 'libraries_to_link' |
| 456 | action: 'c++-link-executable' |
| 457 | action: 'c++-link-dynamic-library' |
| 458 | action: 'c++-link-static-library' |
| 459 | action: 'c++-link-alwayslink-static-library' |
| 460 | action: 'c++-link-pic-static-library' |
| 461 | action: 'c++-link-alwayslink-pic-static-library' |
| 462 | flag_group { |
| 463 | iterate_over: 'libraries_to_link' |
| 464 | flag_group { |
| 465 | expand_if_true: 'libraries_to_link.is_whole_archive' |
| 466 | iterate_over: 'libraries_to_link.names' |
| 467 | flag: '/WHOLEARCHIVE:%{libraries_to_link.names}' |
| 468 | } |
| 469 | flag_group { |
| 470 | expand_if_false: 'libraries_to_link.is_whole_archive' |
| 471 | iterate_over: 'libraries_to_link.names' |
| 472 | flag: '%{libraries_to_link.names}' |
| 473 | } |
| 474 | } |
| 475 | } |
Yun Peng | 81aede1 | 2016-10-25 13:49:28 +0000 | [diff] [blame] | 476 | } |
| 477 | |
Yun Peng | 56b16e7 | 2016-07-12 10:55:57 +0000 | [diff] [blame] | 478 | compilation_mode_flags { |
| 479 | mode: DBG |
| 480 | compiler_flag: "/DDEBUG=1" |
| 481 | # This will signal the wrapper that we are doing a debug build, which sets |
| 482 | # some internal state of the toolchain wrapper. It is intentionally a "-" |
| 483 | # flag to make this very obvious. |
| 484 | compiler_flag: "-g" |
| 485 | compiler_flag: "/Od" |
| 486 | compiler_flag: "-Xcompilation-mode=dbg" |
Yun Peng | af552c7 | 2016-09-26 12:23:55 +0000 | [diff] [blame] | 487 | linker_flag: "-Xcompilation-mode=dbg" |
Yun Peng | 56b16e7 | 2016-07-12 10:55:57 +0000 | [diff] [blame] | 488 | } |
| 489 | |
| 490 | compilation_mode_flags { |
| 491 | mode: FASTBUILD |
| 492 | compiler_flag: "/DNDEBUG" |
| 493 | compiler_flag: "/Od" |
| 494 | compiler_flag: "-Xcompilation-mode=fastbuild" |
Yun Peng | af552c7 | 2016-09-26 12:23:55 +0000 | [diff] [blame] | 495 | linker_flag: "-Xcompilation-mode=fastbuild" |
Yun Peng | 56b16e7 | 2016-07-12 10:55:57 +0000 | [diff] [blame] | 496 | } |
| 497 | |
| 498 | compilation_mode_flags { |
| 499 | mode: OPT |
| 500 | compiler_flag: "/DNDEBUG" |
| 501 | compiler_flag: "/O2" |
| 502 | compiler_flag: "-Xcompilation-mode=opt" |
Yun Peng | af552c7 | 2016-09-26 12:23:55 +0000 | [diff] [blame] | 503 | linker_flag: "-Xcompilation-mode=opt" |
Yun Peng | 56b16e7 | 2016-07-12 10:55:57 +0000 | [diff] [blame] | 504 | } |
Lukacs Berki | 76a2bbc | 2016-08-22 14:53:38 +0000 | [diff] [blame] | 505 | } |