1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 # ============================================================================= 6 # BUILD FLAGS 7 # ============================================================================= 8 # 9 # This block lists input arguments to the build, along with their default 10 # values. GN requires listing them explicitly so it can validate input and have 11 # a central place to manage the build flags. 12 # 13 # If a value is specified on the command line, it will overwrite the defaults 14 # given here, otherwise the default will be injected into the root scope. 15 # 16 # KEEP IN ALPHABETICAL ORDER and write a good description for everything. 17 # Use "is_*" names for intrinsic platform descriptions and build modes, and 18 # "use_*" names for optional features libraries, and configurations. 19 declare_args() { 20 # How many symbols to include in the build. This affects the performance of 21 # the build since the symbols are large and dealing with them is slow. 22 # 2 means regular build with symbols. 23 # 1 means minimal symbols, usually enough for backtraces only. 24 # 0 means no symbols. 25 # -1 means auto-set (off in release, regular in debug). 26 symbol_level = -1 27 28 # Component build. 29 is_component_build = false 30 # Debug build. 31 is_debug = true 32 33 # Set to true when compiling with the Clang compiler. Typically this is used 34 # to configure warnings. 35 is_clang = (os == "mac" || os == "ios" || os == "linux") 36 37 # Forces a 64-bit build on Windows. Does nothing on other platforms. Normally 38 # we build 32-bit on Windows regardless of the current host OS bit depth. 39 # Setting this flag will override this logic and generate 64-bit toolchains. 40 # 41 # Normally this would get set automatically when you specify a target using 42 # the 64-bit toolchain. You can also set this on the command line to convert 43 # the default toolchain to 64-bit. 44 force_win64 = false 45 46 # Selects the desired build flavor. Official builds get additional 47 # processing to prepare for release. Normally you will want to develop and 48 # test with this flag off. 49 is_official_build = false 50 51 # Select the desired branding flavor. False means normal Chromium branding, 52 # true means official Google Chrome branding (requires extra Google-internal 53 # resources). 54 is_chrome_branded = false 55 56 # Compile for Address Sanitizer to find memory bugs. 57 is_asan = false 58 59 # Compile for Leak Sanitizer to find leaks. 60 is_lsan = false 61 62 # Compile for Memory Sanitizer to find uninitialized reads. 63 is_msan = false 64 65 # Compile for Thread Sanitizer to find threading bugs. 66 is_tsan = false 67 68 if (os == "chromeos") { 69 # Allows the target toolchain to be injected as arguments. This is needed 70 # to support the CrOS build system which supports per-build-configuration 71 # toolchains. 72 cros_use_custom_toolchain = false 73 } 74 } 75 76 # ============================================================================= 77 # OS DEFINITIONS 78 # ============================================================================= 79 # 80 # We set these various is_FOO booleans for convenience in writing OS-based 81 # conditions. 82 # 83 # - is_android, is_chromeos, is_ios, and is_win should be obvious. 84 # - is_mac is set only for desktop Mac. It is not set on iOS. 85 # - is_posix is true for mac and any Unix-like system (basically everything 86 # except Windows). 87 # - is_linux is true for desktop Linux and ChromeOS, but not Android (which is 88 # generally too different despite being based on the Linux kernel). 89 # 90 # Do not add more is_* variants here for random lesser-used Unix systems like 91 # aix or one of the BSDs. If you need to check these, just check the os value 92 # directly. 93 94 if (os == "win") { 95 is_android = false 96 is_chromeos = false 97 is_ios = false 98 is_linux = false 99 is_mac = false 100 is_nacl = false 101 is_posix = false 102 is_win = true 103 } else if (os == "mac") { 104 is_android = false 105 is_chromeos = false 106 is_ios = false 107 is_linux = false 108 is_mac = true 109 is_nacl = false 110 is_posix = true 111 is_win = false 112 } else if (os == "android") { 113 is_android = true 114 is_chromeos = false 115 is_ios = false 116 is_linux = false 117 is_mac = false 118 is_nacl = false 119 is_posix = true 120 is_win = false 121 } else if (os == "chromeos") { 122 is_android = false 123 is_chromeos = true 124 is_ios = false 125 is_linux = true 126 is_mac = false 127 is_nacl = false 128 is_posix = true 129 is_win = false 130 } else if (os == "nacl") { 131 # os == "nacl" will be passed by the nacl toolchain definition. It is not 132 # set by default or on the command line. We treat is as a Posix variant. 133 is_android = false 134 is_chromeos = false 135 is_ios = false 136 is_linux = false 137 is_mac = false 138 is_nacl = true 139 is_posix = true 140 is_win = false 141 } else if (os == "ios") { 142 is_android = false 143 is_chromeos = false 144 is_ios = true 145 is_linux = false 146 is_mac = false 147 is_nacl = false 148 is_posix = true 149 is_win = false 150 } else if (os == "linux") { 151 is_android = false 152 is_chromeos = false 153 is_ios = false 154 is_linux = true 155 is_mac = false 156 is_nacl = false 157 is_posix = true 158 is_win = false 159 } 160 161 is_desktop_linux = is_linux && !is_chromeos 162 163 # ============================================================================= 164 # CPU ARCHITECTURE 165 # ============================================================================= 166 167 if (is_win) { 168 # Always use 32-bit on Windows, even when compiling on a 64-bit host OS, 169 # unless the override flag is specified. 170 if (force_win64) { 171 cpu_arch = "x64" 172 } else { 173 cpu_arch = "x86" 174 } 175 } 176 177 # ============================================================================= 178 # SOURCES FILTERS 179 # ============================================================================= 180 # 181 # These patterns filter out platform-specific files when assigning to the 182 # sources variable. The magic variable |sources_assignment_filter| is applied 183 # to each assignment or appending to the sources variable and matches are 184 # automatcally removed. 185 # 186 # Note that the patterns are NOT regular expressions. Only "*" and "\b" (path 187 # boundary = end of string or slash) are supported, and the entire string 188 # muct match the pattern (so you need "*.cc" to match all .cc files, for 189 # example). 190 191 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call 192 # below. 193 sources_assignment_filter = [] 194 if (!is_posix) { 195 sources_assignment_filter += [ 196 "*_posix.h", 197 "*_posix.cc", 198 "*_posix_unittest.h", 199 "*_posix_unittest.cc", 200 "*\bposix/*", 201 ] 202 } 203 if (!is_win) { 204 sources_assignment_filter += [ 205 "*_win.cc", 206 "*_win.h", 207 "*_win_unittest.cc", 208 "*\bwin/*", 209 "*.rc", 210 ] 211 } 212 if (!is_mac) { 213 sources_assignment_filter += [ 214 "*_mac.h", 215 "*_mac.cc", 216 "*_mac.mm", 217 "*_mac_unittest.h", 218 "*_mac_unittest.cc", 219 "*_mac_unittest.mm", 220 "*\bmac/*", 221 "*_cocoa.h", 222 "*_cocoa.cc", 223 "*_cocoa.mm", 224 "*_cocoa_unittest.h", 225 "*_cocoa_unittest.cc", 226 "*_cocoa_unittest.mm", 227 "*\bcocoa/*", 228 ] 229 } 230 if (!is_ios) { 231 sources_assignment_filter += [ 232 "*_ios.h", 233 "*_ios.cc", 234 "*_ios.mm", 235 "*_ios_unittest.h", 236 "*_ios_unittest.cc", 237 "*_ios_unittest.mm", 238 "*\bios/*", 239 ] 240 } 241 if (!is_mac && !is_ios) { 242 sources_assignment_filter += [ 243 "*.mm", 244 ] 245 } 246 if (!is_linux) { 247 sources_assignment_filter += [ 248 "*_linux.h", 249 "*_linux.cc", 250 "*_linux_unittest.h", 251 "*_linux_unittest.cc", 252 "*\blinux/*", 253 ] 254 } 255 if (!is_android) { 256 sources_assignment_filter += [ 257 "*_android.h", 258 "*_android.cc", 259 "*_android_unittest.h", 260 "*_android_unittest.cc", 261 "*\bandroid/*", 262 ] 263 } 264 if (!is_chromeos) { 265 sources_assignment_filter += [ 266 "*_chromeos.h", 267 "*_chromeos.cc", 268 "*_chromeos_unittest.h", 269 "*_chromeos_unittest.cc", 270 "*\bchromeos/*", 271 ] 272 } 273 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call 274 # below. 275 276 # Actually save this list. 277 # 278 # These patterns are executed for every file in the source tree of every run. 279 # Therefore, adding more patterns slows down the build for everybody. We should 280 # only add automatic patterns for configurations affecting hundreds of files 281 # across many projects in the tree. 282 # 283 # Therefore, we only add rules to this list corresponding to platforms on the 284 # Chromium waterfall. This is not for non-officially-supported platforms 285 # (FreeBSD, etc.) toolkits, (X11, GTK, etc.), or features. For these cases, 286 # write a conditional in the target to remove the file(s) from the list when 287 # your platform/toolkit/feature doesn't apply. 288 set_sources_assignment_filter(sources_assignment_filter) 289 290 # ============================================================================= 291 # BUILD OPTIONS 292 # ============================================================================= 293 294 # These Sanitizers all imply using the Clang compiler. On Windows they either 295 # don't work or work differently. 296 if (!is_clang && (is_asan || is_lsan || is_tsan || is_msan)) { 297 is_clang = true 298 } 299 300 # ============================================================================= 301 # TARGET DEFAULTS 302 # ============================================================================= 303 # 304 # Set up the default configuration for every build target of the given type. 305 # The values configured here will be automatically set on the scope of the 306 # corresponding target. Target definitions can add or remove to the settings 307 # here as needed. 308 309 # Holds all configs used for making native executables and libraries, to avoid 310 # duplication in each target below. 311 _native_compiler_configs = [ 312 "//build/config:feature_flags", 313 314 "//build/config/compiler:compiler", 315 "//build/config/compiler:compiler_arm_fpu", 316 "//build/config/compiler:chromium_code", 317 "//build/config/compiler:default_include_dirs", 318 "//build/config/compiler:default_warnings", 319 "//build/config/compiler:no_rtti", 320 "//build/config/compiler:runtime_library", 321 ] 322 if (is_win) { 323 _native_compiler_configs += [ 324 "//build/config/win:lean_and_mean", 325 "//build/config/win:nominmax", 326 "//build/config/win:sdk", 327 "//build/config/win:unicode", 328 "//build/config/win:winver", 329 ] 330 } 331 if (is_posix) { 332 _native_compiler_configs += [ 333 "//build/config/gcc:no_exceptions", 334 "//build/config/gcc:symbol_visibility_hidden", 335 ] 336 } 337 338 if (is_linux) { 339 _native_compiler_configs += [ "//build/config/linux:sdk", ] 340 } else if (is_mac) { 341 _native_compiler_configs += [ "//build/config/mac:sdk", ] 342 } else if (is_ios) { 343 _native_compiler_configs += [ "//build/config/ios:sdk", ] 344 } else if (is_android) { 345 _native_compiler_configs += [ "//build/config/android:sdk", ] 346 } 347 348 if (is_clang) { 349 _native_compiler_configs += [ 350 "//build/config/clang:find_bad_constructs", 351 "//build/config/clang:extra_warnings", 352 ] 353 } 354 355 # Optimizations and debug checking. 356 if (is_debug) { 357 _native_compiler_configs += [ "//build/config:debug" ] 358 _default_optimization_config = "//build/config/compiler:no_optimize" 359 } else { 360 _native_compiler_configs += [ "//build/config:release" ] 361 _default_optimization_config = "//build/config/compiler:optimize" 362 } 363 _native_compiler_configs += [ _default_optimization_config ] 364 365 # If it wasn't manually set, set to an appropriate default. 366 if (symbol_level == -1) { 367 # Linux is slowed by having symbols as part of the target binary, whereas 368 # Mac and Windows have them separate, so in Release Linux, default them off. 369 if (is_debug || !is_linux) { 370 symbol_level = 2 371 } else { 372 symbol_level = 0 373 } 374 } 375 376 # Symbol setup. 377 if (symbol_level == 2) { 378 _default_symbols_config = "//build/config/compiler:symbols" 379 } else if (symbol_level == 1) { 380 _default_symbols_config = "//build/config/compiler:minimal_symbols" 381 } else if (symbol_level == 0) { 382 _default_symbols_config = "//build/config/compiler:no_symbols" 383 } else { 384 assert(false, "Bad value for symbol_level.") 385 } 386 _native_compiler_configs += [ _default_symbols_config ] 387 388 # Windows linker setup for EXEs and DLLs. 389 if (is_win) { 390 if (is_debug) { 391 _default_incremental_linking_config = 392 "//build/config/win:incremental_linking" 393 } else { 394 _default_incremental_linking_config = 395 "//build/config/win:no_incremental_linking" 396 } 397 _windows_linker_configs = [ 398 _default_incremental_linking_config, 399 "//build/config/win:sdk_link", 400 "//build/config/win:common_linker_setup", 401 # Default to console-mode apps. Most of our targets are tests and such 402 # that shouldn't use the windows subsystem. 403 "//build/config/win:console", 404 ] 405 } 406 407 # Executable defaults. 408 _executable_configs = _native_compiler_configs + [ 409 "//build/config:default_libs", 410 ] 411 if (is_win) { 412 _executable_configs += _windows_linker_configs 413 } else if (is_mac) { 414 _executable_configs += [ 415 "//build/config/mac:mac_dynamic_flags", 416 "//build/config/mac:mac_executable_flags" ] 417 } else if (is_linux || is_android) { 418 _executable_configs += [ "//build/config/gcc:executable_ldconfig" ] 419 } 420 set_defaults("executable") { 421 configs = _executable_configs 422 } 423 424 # Static library defaults. 425 set_defaults("static_library") { 426 configs = _native_compiler_configs 427 } 428 429 # Shared library defaults (also for components in component mode). 430 _shared_library_configs = _native_compiler_configs + [ 431 "//build/config:default_libs", 432 ] 433 if (is_win) { 434 _shared_library_configs += _windows_linker_configs 435 } else if (is_mac) { 436 _shared_library_configs += [ "//build/config/mac:mac_dynamic_flags" ] 437 } 438 set_defaults("shared_library") { 439 configs = _shared_library_configs 440 } 441 if (is_component_build) { 442 set_defaults("component") { 443 configs = _shared_library_configs 444 } 445 } 446 447 # Source set defaults (also for components in non-component mode). 448 set_defaults("source_set") { 449 configs = _native_compiler_configs 450 } 451 if (!is_component_build) { 452 set_defaults("component") { 453 configs = _native_compiler_configs 454 } 455 } 456 457 # Test defaults. 458 set_defaults("test") { 459 if (is_android) { 460 configs = _shared_library_configs 461 } else { 462 configs = _executable_configs 463 } 464 } 465 466 467 # ============================================================================== 468 # TOOLCHAIN SETUP 469 # ============================================================================== 470 # 471 # Here we set the default toolchain, as well as the variable host_toolchain 472 # which will identify the toolchain corresponding to the local system when 473 # doing cross-compiles. When not cross-compiling, this will be the same as the 474 # default toolchain. 475 476 if (is_win) { 477 # TODO(brettw) name the toolchains the same as cpu_arch as with Linux below 478 # to eliminate these conditionals. 479 if (build_cpu_arch == "x64") { 480 host_toolchain = "//build/toolchain/win:64" 481 } else if (build_cpu_arch == "x86") { 482 host_toolchain = "//build/toolchain/win:32" 483 } 484 485 if (cpu_arch == "x64") { 486 set_default_toolchain("//build/toolchain/win:64") 487 } else if (cpu_arch == "x86") { 488 set_default_toolchain("//build/toolchain/win:32") 489 } 490 } else if (is_android) { 491 # Use clang for the x86/64 Linux host builds. 492 if (build_cpu_arch == "x86" || build_cpu_arch == "x64") { 493 host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch" 494 } else { 495 host_toolchain = "//build/toolchain/linux:$build_cpu_arch" 496 } 497 set_default_toolchain("//build/toolchain/android:$cpu_arch") 498 } else if (is_linux) { 499 if (is_clang) { 500 host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch" 501 set_default_toolchain("//build/toolchain/linux:clang_$cpu_arch") 502 } else { 503 host_toolchain = "//build/toolchain/linux:$build_cpu_arch" 504 set_default_toolchain("//build/toolchain/linux:$cpu_arch") 505 } 506 if (is_chromeos && cros_use_custom_toolchain) { 507 set_default_toolchain("//build/toolchain/cros:target") 508 } 509 } else if (is_mac) { 510 host_toolchain = "//build/toolchain/mac:clang" 511 set_default_toolchain(host_toolchain) 512 } else if (is_ios) { 513 host_toolchain = "//build/toolchain/mac:host_clang" 514 set_default_toolchain("//build/toolchain/mac:clang") 515 } 516 517 # ============================================================================== 518 # COMPONENT SETUP 519 # ============================================================================== 520 521 # TODO(brettw) erase this once the built-in "component" function is removed. 522 if (is_component_build) { 523 component_mode = "shared_library" 524 } else { 525 component_mode = "source_set" 526 } 527 528 template("component") { 529 if (is_component_build) { 530 shared_library(target_name) { 531 # Configs will always be defined since we set_defaults for a component 532 # above. We want to use those rather than whatever came with the nested 533 # shared/static library inside the component. 534 configs = [] # Prevent list overwriting warning. 535 configs = invoker.configs 536 537 # The sources assignment filter will have already been applied when the 538 # code was originally executed. We don't want to apply it again, since 539 # the original target may have override it for some assignments. 540 set_sources_assignment_filter([]) 541 542 if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs } 543 if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from } 544 if (defined(invoker.cflags)) { cflags = invoker.cflags } 545 if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c } 546 if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc } 547 if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc } 548 if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc } 549 if (defined(invoker.check_includes)) { check_includes = invoker.check_includes } 550 if (defined(invoker.data)) { data = invoker.data } 551 if (defined(invoker.datadeps)) { datadeps = invoker.datadeps } 552 if (defined(invoker.defines)) { defines = invoker.defines } 553 if (defined(invoker.deps)) { deps = invoker.deps } 554 if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs } 555 if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from } 556 if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs } 557 if (defined(invoker.ldflags)) { ldflags = invoker.ldflags } 558 if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs } 559 if (defined(invoker.libs)) { libs = invoker.libs } 560 if (defined(invoker.output_extension)) { output_extension = invoker.output_extension } 561 if (defined(invoker.output_name)) { output_name = invoker.output_name } 562 if (defined(invoker.public)) { public = invoker.public } 563 if (defined(invoker.public_configs)) { public_configs = invoker.public_configs } 564 if (defined(invoker.public_deps)) { public_deps = invoker.public_deps } 565 if (defined(invoker.sources)) { sources = invoker.sources } 566 if (defined(invoker.testonly)) { testonly = invoker.testonly } 567 if (defined(invoker.visibility)) { visibility = invoker.visibility } 568 } 569 } else { 570 source_set(target_name) { 571 # See above. 572 configs = [] # Prevent list overwriting warning. 573 configs = invoker.configs 574 575 # See above call. 576 set_sources_assignment_filter([]) 577 578 if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs } 579 if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from } 580 if (defined(invoker.cflags)) { cflags = invoker.cflags } 581 if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c } 582 if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc } 583 if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc } 584 if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc } 585 if (defined(invoker.check_includes)) { check_includes = invoker.check_includes } 586 if (defined(invoker.data)) { data = invoker.data } 587 if (defined(invoker.datadeps)) { datadeps = invoker.datadeps } 588 if (defined(invoker.defines)) { defines = invoker.defines } 589 if (defined(invoker.deps)) { deps = invoker.deps } 590 if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs } 591 if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from } 592 if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs } 593 if (defined(invoker.ldflags)) { ldflags = invoker.ldflags } 594 if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs } 595 if (defined(invoker.libs)) { libs = invoker.libs } 596 if (defined(invoker.output_extension)) { output_extension = invoker.output_extension } 597 if (defined(invoker.output_name)) { output_name = invoker.output_name } 598 if (defined(invoker.public)) { public = invoker.public } 599 if (defined(invoker.public_configs)) { public_configs = invoker.public_configs } 600 if (defined(invoker.public_deps)) { public_deps = invoker.public_deps } 601 if (defined(invoker.sources)) { sources = invoker.sources } 602 if (defined(invoker.testonly)) { testonly = invoker.testonly } 603 if (defined(invoker.visibility)) { visibility = invoker.visibility } 604 } 605 } 606 } 607 608 # ============================================================================== 609 # TEST SETUP 610 # ============================================================================== 611 612 # Define a test as an executable (or shared_library on Android) with the 613 # "testonly" flag set. 614 template("test") { 615 if (is_android) { 616 shared_library(target_name) { 617 # Configs will always be defined since we set_defaults for a component 618 # above. We want to use those rather than whatever came with the nested 619 # shared/static library inside the component. 620 configs = [] # Prevent list overwriting warning. 621 configs = invoker.configs 622 623 # See above call. 624 set_sources_assignment_filter([]) 625 626 testonly = true 627 628 if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs } 629 if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from } 630 if (defined(invoker.cflags)) { cflags = invoker.cflags } 631 if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c } 632 if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc } 633 if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc } 634 if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc } 635 if (defined(invoker.check_includes)) { check_includes = invoker.check_includes } 636 if (defined(invoker.data)) { data = invoker.data } 637 if (defined(invoker.datadeps)) { datadeps = invoker.datadeps } 638 if (defined(invoker.defines)) { defines = invoker.defines } 639 if (defined(invoker.deps)) { deps = invoker.deps } 640 if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs } 641 if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from } 642 if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs } 643 if (defined(invoker.ldflags)) { ldflags = invoker.ldflags } 644 if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs } 645 if (defined(invoker.libs)) { libs = invoker.libs } 646 if (defined(invoker.output_extension)) { output_extension = invoker.output_extension } 647 if (defined(invoker.output_name)) { output_name = invoker.output_name } 648 if (defined(invoker.public)) { public = invoker.public } 649 if (defined(invoker.public_configs)) { public_configs = invoker.public_configs } 650 if (defined(invoker.public_deps)) { public_deps = invoker.public_deps } 651 if (defined(invoker.sources)) { sources = invoker.sources } 652 if (defined(invoker.visibility)) { visibility = invoker.visibility } 653 } 654 } else { 655 executable(target_name) { 656 # See above. 657 configs = [] # Prevent list overwriting warning. 658 configs = invoker.configs 659 660 # See above call. 661 set_sources_assignment_filter([]) 662 663 testonly = true 664 665 if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs } 666 if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from } 667 if (defined(invoker.cflags)) { cflags = invoker.cflags } 668 if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c } 669 if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc } 670 if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc } 671 if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc } 672 if (defined(invoker.check_includes)) { check_includes = invoker.check_includes } 673 if (defined(invoker.data)) { data = invoker.data } 674 if (defined(invoker.datadeps)) { datadeps = invoker.datadeps } 675 if (defined(invoker.defines)) { defines = invoker.defines } 676 if (defined(invoker.deps)) { deps = invoker.deps } 677 if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs } 678 if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from } 679 if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs } 680 if (defined(invoker.ldflags)) { ldflags = invoker.ldflags } 681 if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs } 682 if (defined(invoker.libs)) { libs = invoker.libs } 683 if (defined(invoker.output_extension)) { output_extension = invoker.output_extension } 684 if (defined(invoker.output_name)) { output_name = invoker.output_name } 685 if (defined(invoker.public)) { public = invoker.public } 686 if (defined(invoker.public_configs)) { public_configs = invoker.public_configs } 687 if (defined(invoker.public_deps)) { public_deps = invoker.public_deps } 688 if (defined(invoker.sources)) { sources = invoker.sources } 689 if (defined(invoker.visibility)) { visibility = invoker.visibility } 690 } 691 } 692 } 693