Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: BUILD.gn

Issue 2381273002: Turn libbase into a component (Closed)
Patch Set: updates Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | samples/samples.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/arm.gni") 6 import("//build/config/arm.gni")
7 import("//build/config/dcheck_always_on.gni") 7 import("//build/config/dcheck_always_on.gni")
8 import("//build/config/mips.gni") 8 import("//build/config/mips.gni")
9 import("//build/config/sanitizers/sanitizers.gni") 9 import("//build/config/sanitizers/sanitizers.gni")
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 visibility = [ ":*" ] # Only targets in this file can depend on this. 123 visibility = [ ":*" ] # Only targets in this file can depend on this.
124 124
125 include_dirs = [ "." ] 125 include_dirs = [ "." ]
126 } 126 }
127 127
128 # This config should be applied to code using the libplatform. 128 # This config should be applied to code using the libplatform.
129 config("libplatform_config") { 129 config("libplatform_config") {
130 include_dirs = [ "include" ] 130 include_dirs = [ "include" ]
131 } 131 }
132 132
133 # This config should be applied to code using the libbase.
134 config("libbase_config") {
135 if (is_component_build) {
136 defines = [ "USING_V8_BASE_SHARED" ]
137 }
138 libs = []
139 if (is_android && current_toolchain != host_toolchain) {
140 libs += [ "log" ]
141 }
142 }
143
133 # This config should be applied to code using the libsampler. 144 # This config should be applied to code using the libsampler.
134 config("libsampler_config") { 145 config("libsampler_config") {
135 include_dirs = [ "include" ] 146 include_dirs = [ "include" ]
136 } 147 }
137 148
138 # This config should only be applied to code using V8 and not any V8 code 149 # This config should only be applied to code using V8 and not any V8 code
139 # itself. 150 # itself.
140 config("external_config") { 151 config("external_config") {
141 if (is_component_build) { 152 if (is_component_build) {
142 defines = [ "USING_V8_SHARED" ] 153 defines = [ "USING_V8_SHARED" ]
143 } 154 }
144 include_dirs = [ "include" ] 155 include_dirs = [ "include" ]
145 if (v8_enable_inspector_override) { 156 if (v8_enable_inspector_override) {
146 include_dirs += [ "$target_gen_dir/include" ] 157 include_dirs += [ "$target_gen_dir/include" ]
147 } 158 }
148 libs = []
149 if (is_android && current_toolchain != host_toolchain) {
150 libs += [ "log" ]
151 }
152 } 159 }
153 160
154 # This config should only be applied to code that needs to be explicitly 161 # This config should only be applied to code that needs to be explicitly
155 # aware of whether we are using startup data or not. 162 # aware of whether we are using startup data or not.
156 config("external_startup_data") { 163 config("external_startup_data") {
157 if (v8_use_external_startup_data) { 164 if (v8_use_external_startup_data) {
158 defines = [ "V8_USE_EXTERNAL_STARTUP_DATA" ] 165 defines = [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
159 } 166 }
160 } 167 }
161 168
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 if (v8_postmortem_support) { 2149 if (v8_postmortem_support) {
2143 sources += [ "$target_gen_dir/debug-support.cc" ] 2150 sources += [ "$target_gen_dir/debug-support.cc" ]
2144 deps += [ ":postmortem-metadata" ] 2151 deps += [ ":postmortem-metadata" ]
2145 } 2152 }
2146 2153
2147 if (v8_enable_inspector_override) { 2154 if (v8_enable_inspector_override) {
2148 deps += [ "src/inspector:inspector" ] 2155 deps += [ "src/inspector:inspector" ]
2149 } 2156 }
2150 } 2157 }
2151 2158
2152 v8_source_set("v8_libbase") { 2159 v8_component("v8_libbase") {
2153 visibility = [ ":*" ] # Only targets in this file can depend on this.
2154
2155 sources = [ 2160 sources = [
2156 "src/base/adapters.h", 2161 "src/base/adapters.h",
2157 "src/base/atomic-utils.h", 2162 "src/base/atomic-utils.h",
2158 "src/base/atomicops.h", 2163 "src/base/atomicops.h",
2159 "src/base/atomicops_internals_arm64_gcc.h", 2164 "src/base/atomicops_internals_arm64_gcc.h",
2160 "src/base/atomicops_internals_arm_gcc.h", 2165 "src/base/atomicops_internals_arm_gcc.h",
2161 "src/base/atomicops_internals_atomicword_compat.h", 2166 "src/base/atomicops_internals_atomicword_compat.h",
2162 "src/base/atomicops_internals_mac.h", 2167 "src/base/atomicops_internals_mac.h",
2163 "src/base/atomicops_internals_mips64_gcc.h", 2168 "src/base/atomicops_internals_mips64_gcc.h",
2164 "src/base/atomicops_internals_mips_gcc.h", 2169 "src/base/atomicops_internals_mips_gcc.h",
2165 "src/base/atomicops_internals_s390_gcc.h", 2170 "src/base/atomicops_internals_s390_gcc.h",
2166 "src/base/atomicops_internals_tsan.h", 2171 "src/base/atomicops_internals_tsan.h",
2167 "src/base/atomicops_internals_x86_gcc.cc", 2172 "src/base/atomicops_internals_x86_gcc.cc",
2168 "src/base/atomicops_internals_x86_gcc.h", 2173 "src/base/atomicops_internals_x86_gcc.h",
2169 "src/base/atomicops_internals_x86_msvc.h", 2174 "src/base/atomicops_internals_x86_msvc.h",
2175 "src/base/base-export.h",
2170 "src/base/bits.cc", 2176 "src/base/bits.cc",
2171 "src/base/bits.h", 2177 "src/base/bits.h",
2172 "src/base/build_config.h", 2178 "src/base/build_config.h",
2173 "src/base/compiler-specific.h", 2179 "src/base/compiler-specific.h",
2174 "src/base/cpu.cc", 2180 "src/base/cpu.cc",
2175 "src/base/cpu.h", 2181 "src/base/cpu.h",
2176 "src/base/debug/stack_trace.cc", 2182 "src/base/debug/stack_trace.cc",
2177 "src/base/debug/stack_trace.h", 2183 "src/base/debug/stack_trace.h",
2178 "src/base/division-by-constant.cc", 2184 "src/base/division-by-constant.cc",
2179 "src/base/division-by-constant.h", 2185 "src/base/division-by-constant.h",
(...skipping 30 matching lines...) Expand all
2210 "src/base/safe_math.h", 2216 "src/base/safe_math.h",
2211 "src/base/safe_math_impl.h", 2217 "src/base/safe_math_impl.h",
2212 "src/base/sys-info.cc", 2218 "src/base/sys-info.cc",
2213 "src/base/sys-info.h", 2219 "src/base/sys-info.h",
2214 "src/base/utils/random-number-generator.cc", 2220 "src/base/utils/random-number-generator.cc",
2215 "src/base/utils/random-number-generator.h", 2221 "src/base/utils/random-number-generator.h",
2216 ] 2222 ]
2217 2223
2218 configs = [ ":internal_config_base" ] 2224 configs = [ ":internal_config_base" ]
2219 2225
2226 public_configs = [ ":libbase_config" ]
2227
2220 defines = [] 2228 defines = []
2221 2229
2230 if (is_component_build) {
2231 defines = [ "BUILDING_V8_BASE_SHARED" ]
2232 }
2233
2222 if (is_posix) { 2234 if (is_posix) {
2223 sources += [ "src/base/platform/platform-posix.cc" ] 2235 sources += [ "src/base/platform/platform-posix.cc" ]
2224 } 2236 }
2225 2237
2226 if (is_linux) { 2238 if (is_linux) {
2227 sources += [ 2239 sources += [
2228 "src/base/debug/stack_trace_posix.cc", 2240 "src/base/debug/stack_trace_posix.cc",
2229 "src/base/platform/platform-linux.cc", 2241 "src/base/platform/platform-linux.cc",
2230 ] 2242 ]
2231 2243
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2355 "test/fuzzer/fuzzer-support.h", 2367 "test/fuzzer/fuzzer-support.h",
2356 ] 2368 ]
2357 2369
2358 configs = [ ":internal_config_base" ] 2370 configs = [ ":internal_config_base" ]
2359 2371
2360 deps = [ 2372 deps = [
2361 ":v8_maybe_snapshot", 2373 ":v8_maybe_snapshot",
2362 ] 2374 ]
2363 2375
2364 public_deps = [ 2376 public_deps = [
2377 ":v8_libbase",
2365 ":v8_libplatform", 2378 ":v8_libplatform",
2366 ] 2379 ]
2367 } 2380 }
2368 2381
2369 v8_source_set("simple_fuzzer") { 2382 v8_source_set("simple_fuzzer") {
2370 sources = [ 2383 sources = [
2371 "test/fuzzer/fuzzer.cc", 2384 "test/fuzzer/fuzzer.cc",
2372 ] 2385 ]
2373 2386
2374 configs = [ ":internal_config_base" ] 2387 configs = [ ":internal_config_base" ]
2375 } 2388 }
2376 2389
2377 ############################################################################### 2390 ###############################################################################
2378 # Executables 2391 # Executables
2379 # 2392 #
2380 2393
2381 if (current_toolchain == v8_snapshot_toolchain) { 2394 if (current_toolchain == v8_snapshot_toolchain) {
2382 v8_executable("mksnapshot") { 2395 v8_executable("mksnapshot") {
2383 visibility = [ ":*" ] # Only targets in this file can depend on this. 2396 visibility = [ ":*" ] # Only targets in this file can depend on this.
2384 2397
2385 sources = [ 2398 sources = [
2386 "src/snapshot/mksnapshot.cc", 2399 "src/snapshot/mksnapshot.cc",
2387 ] 2400 ]
2388 2401
2389 configs = [ ":internal_config" ] 2402 configs = [ ":internal_config" ]
2390 2403
2391 deps = [ 2404 deps = [
2392 ":v8_base", 2405 ":v8_base",
2406 ":v8_libbase",
2393 ":v8_libplatform", 2407 ":v8_libplatform",
2394 ":v8_nosnapshot", 2408 ":v8_nosnapshot",
2395 "//build/config/sanitizers:deps", 2409 "//build/config/sanitizers:deps",
2396 "//build/win:default_exe_manifest", 2410 "//build/win:default_exe_manifest",
2397 ] 2411 ]
2398 } 2412 }
2399 } 2413 }
2400 2414
2401 v8_executable("mkpeephole") { 2415 v8_executable("mkpeephole") {
2402 # mkpeephole needs to be built for the build host so the peephole lookup 2416 # mkpeephole needs to be built for the build host so the peephole lookup
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2505 configs = [ 2519 configs = [
2506 # Note: don't use :internal_config here because this target will get 2520 # Note: don't use :internal_config here because this target will get
2507 # the :external_config applied to it by virtue of depending on :v8, and 2521 # the :external_config applied to it by virtue of depending on :v8, and
2508 # you can't have both applied to the same target. 2522 # you can't have both applied to the same target.
2509 ":internal_config_base", 2523 ":internal_config_base",
2510 ] 2524 ]
2511 2525
2512 deps = [ 2526 deps = [
2513 ":d8_js2c", 2527 ":d8_js2c",
2514 ":v8", 2528 ":v8",
2529 ":v8_libbase",
2515 ":v8_libplatform", 2530 ":v8_libplatform",
2516 "//build/config/sanitizers:deps", 2531 "//build/config/sanitizers:deps",
2517 "//build/win:default_exe_manifest", 2532 "//build/win:default_exe_manifest",
2518 ] 2533 ]
2519 2534
2520 # TODO(jochen): Add support for vtunejit. 2535 # TODO(jochen): Add support for vtunejit.
2521 2536
2522 if (is_posix) { 2537 if (is_posix) {
2523 sources += [ "src/d8-posix.cc" ] 2538 sources += [ "src/d8-posix.cc" ]
2524 } else if (is_win) { 2539 } else if (is_win) {
(...skipping 20 matching lines...) Expand all
2545 2560
2546 configs = [ 2561 configs = [
2547 # Note: don't use :internal_config here because this target will get 2562 # Note: don't use :internal_config here because this target will get
2548 # the :external_config applied to it by virtue of depending on :v8, and 2563 # the :external_config applied to it by virtue of depending on :v8, and
2549 # you can't have both applied to the same target. 2564 # you can't have both applied to the same target.
2550 ":internal_config_base", 2565 ":internal_config_base",
2551 ] 2566 ]
2552 2567
2553 deps = [ 2568 deps = [
2554 ":v8", 2569 ":v8",
2570 ":v8_libbase",
2555 ":v8_libplatform", 2571 ":v8_libplatform",
2556 "//build/config/sanitizers:deps", 2572 "//build/config/sanitizers:deps",
2557 "//build/win:default_exe_manifest", 2573 "//build/win:default_exe_manifest",
2558 ] 2574 ]
2559 2575
2560 if (v8_enable_i18n_support) { 2576 if (v8_enable_i18n_support) {
2561 deps += [ "//third_party/icu" ] 2577 deps += [ "//third_party/icu" ]
2562 } 2578 }
2563 } 2579 }
2564 2580
2565 v8_executable("v8_sample_process") { 2581 v8_executable("v8_sample_process") {
2566 sources = [ 2582 sources = [
2567 "samples/process.cc", 2583 "samples/process.cc",
2568 ] 2584 ]
2569 2585
2570 configs = [ 2586 configs = [
2571 # Note: don't use :internal_config here because this target will get 2587 # Note: don't use :internal_config here because this target will get
2572 # the :external_config applied to it by virtue of depending on :v8, and 2588 # the :external_config applied to it by virtue of depending on :v8, and
2573 # you can't have both applied to the same target. 2589 # you can't have both applied to the same target.
2574 ":internal_config_base", 2590 ":internal_config_base",
2575 ] 2591 ]
2576 2592
2577 deps = [ 2593 deps = [
2578 ":v8", 2594 ":v8",
2595 ":v8_libbase",
2579 ":v8_libplatform", 2596 ":v8_libplatform",
2580 "//build/config/sanitizers:deps", 2597 "//build/config/sanitizers:deps",
2581 "//build/win:default_exe_manifest", 2598 "//build/win:default_exe_manifest",
2582 ] 2599 ]
2583 2600
2584 if (v8_enable_i18n_support) { 2601 if (v8_enable_i18n_support) {
2585 deps += [ "//third_party/icu" ] 2602 deps += [ "//third_party/icu" ]
2586 } 2603 }
2587 } 2604 }
2588 2605
2589 v8_executable("v8_parser_shell") { 2606 v8_executable("v8_parser_shell") {
2590 sources = [ 2607 sources = [
2591 "tools/parser-shell.cc", 2608 "tools/parser-shell.cc",
2592 "tools/shell-utils.h", 2609 "tools/shell-utils.h",
2593 ] 2610 ]
2594 2611
2595 configs = [ 2612 configs = [
2596 ":external_config", 2613 ":external_config",
2597 ":internal_config_base", 2614 ":internal_config_base",
2598 ] 2615 ]
2599 2616
2600 deps = [ 2617 deps = [
2618 ":v8_libbase",
2601 ":v8_libplatform", 2619 ":v8_libplatform",
2602 "//build/config/sanitizers:deps", 2620 "//build/config/sanitizers:deps",
2603 "//build/win:default_exe_manifest", 2621 "//build/win:default_exe_manifest",
2604 ] 2622 ]
2605 2623
2606 if (is_component_build) { 2624 if (is_component_build) {
2607 # v8_parser_shell can't be built against a shared library, so we 2625 # v8_parser_shell can't be built against a shared library, so we
2608 # need to depend on the underlying static target in that case. 2626 # need to depend on the underlying static target in that case.
2609 deps += [ ":v8_maybe_snapshot" ] 2627 deps += [ ":v8_maybe_snapshot" ]
2610 } else { 2628 } else {
(...skipping 23 matching lines...) Expand all
2634 2652
2635 configs = [ 2653 configs = [
2636 # Note: don't use :internal_config here because this target will get 2654 # Note: don't use :internal_config here because this target will get
2637 # the :external_config applied to it by virtue of depending on :v8, and 2655 # the :external_config applied to it by virtue of depending on :v8, and
2638 # you can't have both applied to the same target. 2656 # you can't have both applied to the same target.
2639 ":internal_config_base", 2657 ":internal_config_base",
2640 ] 2658 ]
2641 2659
2642 deps = [ 2660 deps = [
2643 ":v8", 2661 ":v8",
2662 ":v8_libbase",
2644 ":v8_libplatform", 2663 ":v8_libplatform",
2645 "//build/config/sanitizers:deps", 2664 "//build/config/sanitizers:deps",
2646 "//build/win:default_exe_manifest", 2665 "//build/win:default_exe_manifest",
2647 ] 2666 ]
2648 2667
2649 if (v8_enable_i18n_support) { 2668 if (v8_enable_i18n_support) {
2650 deps += [ "//third_party/icu" ] 2669 deps += [ "//third_party/icu" ]
2651 } 2670 }
2652 } 2671 }
2653 } 2672 }
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2933 ] 2952 ]
2934 2953
2935 configs = [ 2954 configs = [
2936 ":external_config", 2955 ":external_config",
2937 ":internal_config_base", 2956 ":internal_config_base",
2938 ] 2957 ]
2939 } 2958 }
2940 2959
2941 v8_fuzzer("wasm_data_section_fuzzer") { 2960 v8_fuzzer("wasm_data_section_fuzzer") {
2942 } 2961 }
OLDNEW
« no previous file with comments | « no previous file | samples/samples.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698