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