1// Copyright (C) 2015 The Android Open Source Project 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 15// Common defaults 16// ======================================================== 17 18// Using Chrome header files directly could cause -Wunused-parameter errors, 19// and this is workaround. Please find the document in include_generator.py 20// for details. 21// Note: gensrcs does not support exclude_srcs, so filegroup rule is 22// introduced. 23filegroup { 24 name: "libchrome-include-sources", 25 srcs: [ 26 "base/**/*.h", 27 "build/**/*.h", 28 "components/**/*.h", 29 "device/**/*.h", 30 "testing/**/*.h", 31 "third_party/**/*.h", 32 "ui/**/*.h", 33 ], 34 exclude_srcs: [ 35 "base/android/**/*", 36 ], 37} 38 39gensrcs { 40 name: "libchrome-include", 41 cmd: "$(location libchrome_tools/include_generator.py) $(in) $(out)", 42 tool_files: ["libchrome_tools/include_generator.py"], 43 export_include_dirs: ["."], 44 srcs: [":libchrome-include-sources"], 45 output_extension: "h", 46} 47 48cc_defaults { 49 name: "libchrome-defaults", 50 // Set clang to "true" to force clang or "false" to force gcc. 51 // clang: true, 52 53 cflags: [ 54 "-Wall", 55 "-Werror", 56 "-Wno-deprecated-declarations", 57 "-Wno-implicit-fallthrough", 58 // memory_mapped_file.cc:80, json_parser.cc:264, 59 // sys_string_conversions_posix.cc:122, and 60 // icu_utf.cc:161,165 have -Wno-implicit-fallthrough. 61 "-Wno-missing-field-initializers", 62 "-Wno-unused-parameter", 63 ], 64 65 // Note: Although the generated header files are exported here, in building 66 // libchrome, "." has priority (unlike building projects using libchrome), 67 // so the raw header files are used for them. 68 generated_headers: ["libchrome-include"], 69 export_generated_headers: ["libchrome-include"], 70 target: { 71 host: { 72 cflags: [ 73 "-D__ANDROID_HOST__", 74 "-DDONT_EMBED_BUILD_METADATA", 75 ], 76 }, 77 darwin: { 78 enabled: false, 79 }, 80 }, 81} 82 83cc_defaults { 84 name: "libchrome-test-defaults", 85 defaults: ["libchrome-defaults"], 86 cflags: [ 87 "-Wno-unused-function", 88 "-Wno-unused-variable", 89 ], 90 91 clang_cflags: [ 92 // Temporarily suppress the warnings http://b/38232827 93 "-Wno-error=unused-lambda-capture", 94 ], 95} 96 97libchromeCommonSrc = [ 98 "base/at_exit.cc", 99 "base/barrier_closure.cc", 100 "base/base64.cc", 101 "base/base64url.cc", 102 "base/base_paths.cc", 103 "base/base_paths_posix.cc", 104 "base/base_switches.cc", 105 "base/big_endian.cc", 106 "base/build_time.cc", 107 "base/callback_helpers.cc", 108 "base/callback_internal.cc", 109 "base/command_line.cc", 110 "base/cpu.cc", 111 "base/debug/activity_tracker.cc", 112 "base/debug/alias.cc", 113 "base/debug/crash_logging.cc", 114 "base/debug/debugger.cc", 115 "base/debug/debugger_posix.cc", 116 "base/debug/dump_without_crashing.cc", 117 "base/debug/proc_maps_linux.cc", 118 "base/debug/profiler.cc", 119 "base/debug/stack_trace.cc", 120 "base/debug/task_annotator.cc", 121 "base/environment.cc", 122 "base/feature_list.cc", 123 "base/files/file.cc", 124 "base/files/file_descriptor_watcher_posix.cc", 125 "base/files/file_enumerator.cc", 126 "base/files/file_enumerator_posix.cc", 127 "base/files/file_path.cc", 128 "base/files/file_path_constants.cc", 129 "base/files/file_path_watcher.cc", 130 "base/files/file_posix.cc", 131 "base/files/file_tracing.cc", 132 "base/files/file_util.cc", 133 "base/files/file_util_posix.cc", 134 "base/files/important_file_writer.cc", 135 "base/files/memory_mapped_file.cc", 136 "base/files/memory_mapped_file_posix.cc", 137 "base/files/scoped_file.cc", 138 "base/files/scoped_temp_dir.cc", 139 "base/guid.cc", 140 "base/hash.cc", 141 "base/json/json_file_value_serializer.cc", 142 "base/json/json_parser.cc", 143 "base/json/json_reader.cc", 144 "base/json/json_string_value_serializer.cc", 145 "base/json/json_value_converter.cc", 146 "base/json/json_writer.cc", 147 "base/json/string_escape.cc", 148 "base/lazy_instance_helpers.cc", 149 "base/location.cc", 150 "base/logging.cc", 151 "base/md5.cc", 152 "base/memory/aligned_memory.cc", 153 "base/memory/platform_shared_memory_region.cc", 154 "base/memory/platform_shared_memory_region_posix.cc", 155 "base/memory/read_only_shared_memory_region.cc", 156 "base/memory/ref_counted.cc", 157 "base/memory/ref_counted_memory.cc", 158 "base/memory/shared_memory_handle.cc", 159 "base/memory/shared_memory_handle_posix.cc", 160 "base/memory/shared_memory_helper.cc", 161 "base/memory/shared_memory_mapping.cc", 162 "base/memory/unsafe_shared_memory_region.cc", 163 "base/memory/weak_ptr.cc", 164 "base/memory/writable_shared_memory_region.cc", 165 "base/message_loop/incoming_task_queue.cc", 166 "base/message_loop/message_loop.cc", 167 "base/message_loop/message_loop_current.cc", 168 "base/message_loop/message_loop_task_runner.cc", 169 "base/message_loop/message_pump.cc", 170 "base/message_loop/message_pump_default.cc", 171 "base/message_loop/message_pump_libevent.cc", 172 "base/message_loop/watchable_io_message_pump_posix.cc", 173 "base/metrics/bucket_ranges.cc", 174 "base/metrics/dummy_histogram.cc", 175 "base/metrics/field_trial.cc", 176 "base/metrics/field_trial_param_associator.cc", 177 "base/metrics/histogram.cc", 178 "base/metrics/histogram_base.cc", 179 "base/metrics/histogram_functions.cc", 180 "base/metrics/histogram_samples.cc", 181 "base/metrics/histogram_snapshot_manager.cc", 182 "base/metrics/metrics_hashes.cc", 183 "base/metrics/persistent_histogram_allocator.cc", 184 "base/metrics/persistent_memory_allocator.cc", 185 "base/metrics/persistent_sample_map.cc", 186 "base/metrics/sample_map.cc", 187 "base/metrics/sample_vector.cc", 188 "base/metrics/sparse_histogram.cc", 189 "base/metrics/statistics_recorder.cc", 190 "base/native_library.cc", 191 "base/native_library_posix.cc", 192 "base/observer_list_threadsafe.cc", 193 "base/path_service.cc", 194 "base/pending_task.cc", 195 "base/pickle.cc", 196 "base/posix/file_descriptor_shuffle.cc", 197 "base/posix/global_descriptors.cc", 198 "base/posix/safe_strerror.cc", 199 "base/process/kill.cc", 200 "base/process/kill_posix.cc", 201 "base/process/launch.cc", 202 "base/process/launch_posix.cc", 203 "base/process/memory.cc", 204 "base/process/process_handle.cc", 205 "base/process/process_handle_posix.cc", 206 "base/process/process_iterator.cc", 207 "base/process/process_metrics.cc", 208 "base/process/process_metrics_posix.cc", 209 "base/process/process_posix.cc", 210 "base/rand_util.cc", 211 "base/rand_util_posix.cc", 212 "base/run_loop.cc", 213 "base/scoped_native_library.cc", 214 "base/sequence_checker_impl.cc", 215 "base/sequence_token.cc", 216 "base/sequenced_task_runner.cc", 217 "base/sha1.cc", 218 "base/strings/nullable_string16.cc", 219 "base/strings/pattern.cc", 220 "base/strings/safe_sprintf.cc", 221 "base/strings/string16.cc", 222 "base/strings/string_number_conversions.cc", 223 "base/strings/string_piece.cc", 224 "base/strings/string_split.cc", 225 "base/strings/string_util.cc", 226 "base/strings/string_util_constants.cc", 227 "base/strings/stringprintf.cc", 228 "base/strings/utf_string_conversion_utils.cc", 229 "base/strings/utf_string_conversions.cc", 230 "base/sync_socket_posix.cc", 231 "base/synchronization/atomic_flag.cc", 232 "base/synchronization/condition_variable_posix.cc", 233 "base/synchronization/lock.cc", 234 "base/synchronization/lock_impl_posix.cc", 235 "base/synchronization/waitable_event_posix.cc", 236 "base/sys_info.cc", 237 "base/sys_info_posix.cc", 238 "base/task/cancelable_task_tracker.cc", 239 "base/task_runner.cc", 240 "base/task_scheduler/scheduler_lock_impl.cc", 241 "base/task_scheduler/scoped_set_task_priority_for_current_thread.cc", 242 "base/task_scheduler/sequence.cc", 243 "base/task_scheduler/sequence_sort_key.cc", 244 "base/task_scheduler/task.cc", 245 "base/task_scheduler/task_traits.cc", 246 "base/third_party/dynamic_annotations/dynamic_annotations.c", 247 "base/third_party/icu/icu_utf.cc", 248 "base/third_party/nspr/prtime.cc", 249 "base/threading/platform_thread_posix.cc", 250 "base/threading/post_task_and_reply_impl.cc", 251 "base/threading/scoped_blocking_call.cc", 252 "base/threading/sequence_local_storage_map.cc", 253 "base/threading/sequence_local_storage_slot.cc", 254 "base/threading/sequenced_task_runner_handle.cc", 255 "base/threading/simple_thread.cc", 256 "base/threading/thread.cc", 257 "base/threading/thread_checker_impl.cc", 258 "base/threading/thread_collision_warner.cc", 259 "base/threading/thread_id_name_manager.cc", 260 "base/threading/thread_local_storage.cc", 261 "base/threading/thread_local_storage_posix.cc", 262 "base/threading/thread_restrictions.cc", 263 "base/threading/thread_task_runner_handle.cc", 264 "base/time/clock.cc", 265 "base/time/default_clock.cc", 266 "base/time/default_tick_clock.cc", 267 "base/time/tick_clock.cc", 268 "base/time/time.cc", 269 "base/time/time_conversion_posix.cc", 270 "base/time/time_exploded_posix.cc", 271 "base/time/time_now_posix.cc", 272 "base/time/time_override.cc", 273 "base/timer/elapsed_timer.cc", 274 "base/timer/timer.cc", 275 "base/unguessable_token.cc", 276 "base/value_iterators.cc", 277 "base/values.cc", 278 "base/version.cc", 279 "base/vlog.cc", 280 "device/bluetooth/bluetooth_advertisement.cc", 281 "device/bluetooth/bluetooth_uuid.cc", 282 "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.cc", 283 "ui/gfx/geometry/insets.cc", 284 "ui/gfx/geometry/insets_f.cc", 285 "ui/gfx/geometry/point.cc", 286 "ui/gfx/geometry/point_conversions.cc", 287 "ui/gfx/geometry/point_f.cc", 288 "ui/gfx/geometry/rect.cc", 289 "ui/gfx/geometry/rect_f.cc", 290 "ui/gfx/geometry/size.cc", 291 "ui/gfx/geometry/size_conversions.cc", 292 "ui/gfx/geometry/size_f.cc", 293 "ui/gfx/geometry/vector2d.cc", 294 "ui/gfx/geometry/vector2d_f.cc", 295 "ui/gfx/range/range.cc", 296 "ui/gfx/range/range_f.cc", 297] 298 299libchromeLinuxSrc = [ 300 "base/files/file_path_watcher_linux.cc", 301 "base/files/file_util_linux.cc", 302 "base/memory/shared_memory_posix.cc", 303 "base/posix/unix_domain_socket.cc", 304 "base/process/internal_linux.cc", 305 "base/process/memory_linux.cc", 306 "base/process/process_handle_linux.cc", 307 "base/process/process_info_linux.cc", 308 "base/process/process_iterator_linux.cc", 309 "base/process/process_metrics_linux.cc", 310 "base/strings/sys_string_conversions_posix.cc", 311 "base/sys_info_linux.cc", 312 "base/threading/platform_thread_internal_posix.cc", 313 "base/threading/platform_thread_linux.cc", 314 "components/timers/alarm_timer_chromeos.cc", 315] 316 317libchromeLinuxGlibcSrc = [ 318 "base/allocator/allocator_shim.cc", 319 "base/allocator/allocator_shim_default_dispatch_to_glibc.cc", 320 "base/debug/stack_trace_posix.cc", 321] 322 323libchromeAndroidSrc = [ 324 "base/debug/stack_trace_android.cc", 325 "base/memory/shared_memory_android.cc", 326 "base/sys_info_chromeos.cc", 327] 328 329// libchrome static+shared for host and device 330// ======================================================== 331cc_library { 332 name: "libchrome", 333 host_supported: true, 334 recovery_available: true, 335 vendor_available: true, 336 defaults: ["libchrome-defaults"], 337 srcs: libchromeCommonSrc, 338 339 export_shared_lib_headers: ["libbase"], 340 export_static_lib_headers: ["libgtest_prod"], 341 shared_libs: [ 342 "libbase", 343 "libevent", 344 ], 345 static_libs: [ 346 "libgtest_prod", 347 "libmodpb64", 348 ], 349 target: { 350 linux: { 351 srcs: libchromeLinuxSrc, 352 }, 353 linux_glibc: { 354 srcs: libchromeLinuxGlibcSrc, 355 }, 356 android: { 357 srcs: libchromeAndroidSrc, 358 shared_libs: [ 359 "libcutils", 360 "liblog", 361 ], 362 }, 363 }, 364} 365 366// libchrome-crypto shared library for device 367// ======================================================== 368 369// Similar to libchrome, generate wrapped header files. See comments for 370// libchrome-include for the details. 371gensrcs { 372 name: "libchrome-crypto-include", 373 cmd: "$(location libchrome_tools/include_generator.py) $(in) $(out)", 374 tool_files: ["libchrome_tools/include_generator.py"], 375 export_include_dirs: ["."], 376 srcs: ["crypto/**/*.h"], 377 output_extension: "h", 378} 379 380cc_library_shared { 381 name: "libchrome-crypto", 382 vendor_available: true, 383 defaults: ["libchrome-defaults"], 384 srcs: [ 385 "crypto/openssl_util.cc", 386 "crypto/random.cc", 387 "crypto/secure_hash.cc", 388 "crypto/secure_util.cc", 389 "crypto/sha2.cc", 390 ], 391 392 generated_headers: ["libchrome-crypto-include"], 393 export_generated_headers: ["libchrome-crypto-include"], 394 395 shared_libs: [ 396 "libchrome", 397 "libcrypto", 398 "libssl", 399 ], 400} 401 402// Helpers needed for unit tests. 403// ======================================================== 404cc_library_static { 405 name: "libchrome_test_helpers", 406 defaults: ["libchrome-test-defaults"], 407 shared_libs: ["libchrome"], 408 host_supported: true, 409 410 srcs: [ 411 "base/test/gtest_util.cc", 412 "base/test/simple_test_clock.cc", 413 "base/test/simple_test_tick_clock.cc", 414 "base/test/test_file_util.cc", 415 "base/test/test_file_util_linux.cc", 416 "base/test/test_switches.cc", 417 "base/test/test_timeouts.cc", 418 ], 419} 420 421// Helpers needed for unit tests (for host). 422// ======================================================== 423cc_library_host_static { 424 name: "libchrome_test_helpers-host", 425 defaults: ["libchrome-test-defaults"], 426 shared_libs: ["libchrome"], 427 428 srcs: ["base/test/simple_test_clock.cc"], 429} 430 431// Host and target unit tests. Run (from repo root) with: 432// ./out/host/<arch>/nativetest/libchrome_test/libchrome_test 433// or 434// adb shell /data/nativetest/libchrome_test/libchrome_test 435// ======================================================== 436cc_test { 437 name: "libchrome_test", 438 host_supported: true, 439 defaults: ["libchrome-test-defaults"], 440 srcs: [ 441 "base/at_exit_unittest.cc", 442 "base/atomicops_unittest.cc", 443 "base/base64_unittest.cc", 444 "base/base64url_unittest.cc", 445 "base/big_endian_unittest.cc", 446 "base/bind_unittest.cc", 447 "base/bits_unittest.cc", 448 "base/build_time_unittest.cc", 449 "base/callback_helpers_unittest.cc", 450 "base/callback_list_unittest.cc", 451 "base/callback_unittest.cc", 452 "base/cancelable_callback_unittest.cc", 453 "base/command_line_unittest.cc", 454 "base/cpu_unittest.cc", 455 "base/debug/activity_tracker_unittest.cc", 456 "base/debug/debugger_unittest.cc", 457 "base/debug/leak_tracker_unittest.cc", 458 "base/environment_unittest.cc", 459 "base/files/dir_reader_posix_unittest.cc", 460 "base/files/file_descriptor_watcher_posix_unittest.cc", 461 "base/files/file_enumerator_unittest.cc", 462 "base/files/file_path_unittest.cc", 463 "base/files/file_path_watcher_unittest.cc", 464 "base/files/file_unittest.cc", 465 "base/files/important_file_writer_unittest.cc", 466 "base/files/scoped_temp_dir_unittest.cc", 467 "base/gmock_unittest.cc", 468 "base/guid_unittest.cc", 469 "base/json/json_parser_unittest.cc", 470 "base/json/json_reader_unittest.cc", 471 "base/json/json_value_converter_unittest.cc", 472 "base/json/json_value_serializer_unittest.cc", 473 "base/json/json_writer_unittest.cc", 474 "base/json/string_escape_unittest.cc", 475 "base/lazy_instance_unittest.cc", 476 "base/logging_unittest.cc", 477 "base/md5_unittest.cc", 478 "base/memory/aligned_memory_unittest.cc", 479 "base/memory/linked_ptr_unittest.cc", 480 "base/memory/ref_counted_memory_unittest.cc", 481 "base/memory/ref_counted_unittest.cc", 482 "base/memory/singleton_unittest.cc", 483 "base/memory/weak_ptr_unittest.cc", 484 "base/message_loop/message_loop_task_runner_unittest.cc", 485 "base/message_loop/message_loop_unittest.cc", 486 "base/metrics/bucket_ranges_unittest.cc", 487 "base/metrics/field_trial_unittest.cc", 488 "base/metrics/histogram_base_unittest.cc", 489 "base/metrics/histogram_macros_unittest.cc", 490 "base/metrics/histogram_snapshot_manager_unittest.cc", 491 "base/metrics/histogram_unittest.cc", 492 "base/metrics/metrics_hashes_unittest.cc", 493 "base/metrics/persistent_histogram_allocator_unittest.cc", 494 "base/metrics/persistent_memory_allocator_unittest.cc", 495 "base/metrics/persistent_sample_map_unittest.cc", 496 "base/metrics/sample_map_unittest.cc", 497 "base/metrics/sample_vector_unittest.cc", 498 "base/metrics/sparse_histogram_unittest.cc", 499 "base/metrics/statistics_recorder_unittest.cc", 500 "base/observer_list_unittest.cc", 501 "base/optional_unittest.cc", 502 "base/pickle_unittest.cc", 503 "base/posix/file_descriptor_shuffle_unittest.cc", 504 "base/posix/unix_domain_socket_unittest.cc", 505 "base/process/process_info_unittest.cc", 506 "base/process/process_metrics_unittest.cc", 507 "base/rand_util_unittest.cc", 508 "base/scoped_clear_errno_unittest.cc", 509 "base/scoped_generic_unittest.cc", 510 "base/security_unittest.cc", 511 "base/sequence_checker_unittest.cc", 512 "base/sequence_token_unittest.cc", 513 "base/sha1_unittest.cc", 514 "base/stl_util_unittest.cc", 515 "base/strings/pattern_unittest.cc", 516 "base/strings/string16_unittest.cc", 517 "base/strings/string_number_conversions_unittest.cc", 518 "base/strings/string_piece_unittest.cc", 519 "base/strings/string_split_unittest.cc", 520 "base/strings/string_util_unittest.cc", 521 "base/strings/stringprintf_unittest.cc", 522 "base/strings/sys_string_conversions_unittest.cc", 523 "base/strings/utf_string_conversions_unittest.cc", 524 "base/sync_socket_unittest.cc", 525 "base/synchronization/atomic_flag_unittest.cc", 526 "base/synchronization/condition_variable_unittest.cc", 527 "base/synchronization/lock_unittest.cc", 528 "base/synchronization/waitable_event_unittest.cc", 529 "base/sys_info_unittest.cc", 530 "base/task/cancelable_task_tracker_unittest.cc", 531 "base/task_runner_util_unittest.cc", 532 "base/task_scheduler/scheduler_lock_unittest.cc", 533 "base/task_scheduler/scoped_set_task_priority_for_current_thread_unittest.cc", 534 "base/task_scheduler/sequence_sort_key_unittest.cc", 535 "base/task_scheduler/sequence_unittest.cc", 536 "base/task_scheduler/task_traits.cc", 537 "base/template_util_unittest.cc", 538 "base/test/metrics/histogram_tester.cc", 539 "base/test/mock_entropy_provider.cc", 540 "base/test/multiprocess_test.cc", 541 "base/test/scoped_feature_list.cc", 542 "base/test/scoped_locale.cc", 543 "base/test/simple_test_tick_clock.cc", 544 "base/test/test_file_util.cc", 545 "base/test/test_file_util_linux.cc", 546 "base/test/test_file_util_posix.cc", 547 "base/test/test_io_thread.cc", 548 "base/test/test_mock_time_task_runner.cc", 549 "base/test/test_pending_task.cc", 550 "base/test/test_shared_memory_util.cc", 551 "base/test/test_simple_task_runner.cc", 552 "base/test/test_switches.cc", 553 "base/test/test_timeouts.cc", 554 "base/threading/platform_thread_unittest.cc", 555 "base/threading/simple_thread_unittest.cc", 556 "base/threading/thread_checker_unittest.cc", 557 "base/threading/thread_collision_warner_unittest.cc", 558 "base/threading/thread_id_name_manager_unittest.cc", 559 "base/threading/thread_local_storage_unittest.cc", 560 "base/threading/thread_local_unittest.cc", 561 "base/threading/thread_unittest.cc", 562 "base/time/pr_time_unittest.cc", 563 "base/time/time_unittest.cc", 564 "base/timer/hi_res_timer_manager_unittest.cc", 565 "base/timer/mock_timer.cc", 566 "base/tuple_unittest.cc", 567 "base/values_unittest.cc", 568 "base/version_unittest.cc", 569 "base/vlog_unittest.cc", 570 "testing/multiprocess_func_list.cc", 571 "testrunner.cc", 572 "ui/gfx/range/range_unittest.cc", 573 ], 574 575 cflags: ["-DUNIT_TEST"], 576 shared_libs: [ 577 "libchrome", 578 "libevent", 579 ], 580 static_libs: [ 581 "libgmock", 582 "libgtest", 583 ], 584 target: { 585 android: { 586 srcs: [ 587 "crypto/secure_hash_unittest.cc", 588 "crypto/sha2_unittest.cc", 589 ], 590 shared_libs: [ 591 "libchrome-crypto", 592 ], 593 cflags: ["-DDONT_EMBED_BUILD_METADATA"], 594 }, 595 }, 596} 597 598filegroup { 599 name: "libmojo_mojom_files", 600 srcs: [ 601 "ipc/ipc.mojom", 602 "mojo/public/interfaces/bindings/interface_control_messages.mojom", 603 "mojo/public/interfaces/bindings/native_struct.mojom", 604 "mojo/public/interfaces/bindings/pipe_control_messages.mojom", 605 "mojo/public/mojom/base/big_buffer.mojom", 606 "mojo/public/mojom/base/big_string.mojom", 607 "mojo/public/mojom/base/file.mojom", 608 "mojo/public/mojom/base/file_error.mojom", 609 "mojo/public/mojom/base/file_info.mojom", 610 "mojo/public/mojom/base/file_path.mojom", 611 "mojo/public/mojom/base/process_id.mojom", 612 "mojo/public/mojom/base/read_only_buffer.mojom", 613 "mojo/public/mojom/base/ref_counted_memory.mojom", 614 "mojo/public/mojom/base/shared_memory.mojom", 615 "mojo/public/mojom/base/string16.mojom", 616 "mojo/public/mojom/base/text_direction.mojom", 617 "mojo/public/mojom/base/thread_priority.mojom", 618 "mojo/public/mojom/base/time.mojom", 619 "mojo/public/mojom/base/unguessable_token.mojom", 620 "mojo/public/mojom/base/values.mojom", 621 "ui/gfx/geometry/mojo/geometry.mojom", 622 "ui/gfx/range/mojo/range.mojom", 623 ], 624} 625 626filegroup { 627 name: "libmojo_mojo_sources", 628 srcs: [ 629 "mojo/**/*.cc", 630 ], 631 exclude_srcs: [ 632 // Unused in Chrome. Looks like mistakenly checked in. 633 // TODO(hidehiko): Remove this after the file is removed in Chrome 634 // repository. http://crrev.com/c/644531 635 "mojo/public/cpp/system/message.cc", 636 637 // No WTF support. 638 "mojo/public/cpp/bindings/lib/string_traits_wtf.cc", 639 640 // Exclude windows/mac/ios/fuchsia files. 641 "**/*_win.cc", 642 "**/*_fuchsia.cc", 643 "mojo/core/mach_port_relay.*", 644 "mojo/public/cpp/base/logfont_win*", 645 "mojo/public/mojom/base/logfont_win*", 646 647 // Exclude js binding related files. 648 "mojo/public/js/**/*", 649 650 // Exclude tests. 651 "**/*_unittest.cc", 652 "**/*_unittests.cc", 653 "**/*_perftest.cc", 654 "mojo/core/core_test_base.*", 655 "mojo/core/test/*", 656 "mojo/core/test_utils.*", 657 "mojo/public/c/system/tests/**/*", 658 "mojo/public/cpp/bindings/tests/**/*", 659 "mojo/public/cpp/system/tests/**/*", 660 "mojo/public/cpp/test_support/**/*", 661 "mojo/public/java/system/javatests/**/*", 662 "mojo/public/tests/**/*", 663 664 // Exclude memory allocator unsupported feature 665 "mojo/public/cpp/base/memory_allocator_dump_cross_process_uid*", 666 667 // Exclude fuzzers 668 "mojo/public/tools/fuzzers/**/*", 669 ], 670} 671 672// Python in Chrome repository requires still Python 2. 673python_defaults { 674 name: "libmojo_scripts", 675 version: { 676 py2: { 677 enabled: true, 678 }, 679 py3: { 680 enabled: false, 681 }, 682 }, 683} 684 685python_binary_host { 686 name: "jni_generator", 687 main: "base/android/jni_generator/jni_generator.py", 688 srcs: [ 689 "base/android/jni_generator/jni_generator.py", 690 "build/**/*.py", 691 ], 692 defaults: ["libmojo_scripts"], 693} 694 695python_binary_host { 696 name: "jni_registration_generator", 697 main: "base/android/jni_generator/jni_registration_generator.py", 698 srcs: [ 699 "base/android/jni_generator/jni_generator.py", 700 "base/android/jni_generator/jni_registration_generator.py", 701 "build/**/*.py", 702 ], 703 defaults: ["libmojo_scripts"], 704} 705 706python_binary_host { 707 name: "mojom_bindings_generator", 708 main: "mojo/public/tools/bindings/mojom_bindings_generator.py", 709 srcs: [ 710 "build/**/*.py", 711 "mojo/public/tools/bindings/**/*.py", 712 "third_party/jinja2/**/*.py", 713 "third_party/markupsafe/**/*.py", 714 "third_party/ply/**/*.py", 715 ], 716 data: [ 717 "mojo/public/tools/bindings/generators/cpp_templates/*.tmpl", 718 "mojo/public/tools/bindings/generators/java_templates/*.tmpl", 719 "mojo/public/tools/bindings/generators/js_templates/*.tmpl", 720 ], 721 defaults: ["libmojo_scripts"], 722} 723 724genrule { 725 name: "libmojo_mojom_templates", 726 cmd: "$(location mojom_bindings_generator)" + 727 " --use_bundled_pylibs precompile" + 728 " -o $(genDir)", 729 730 tools: [ 731 "mojom_bindings_generator", 732 ], 733 734 out: [ 735 "cpp_templates.zip", 736 "java_templates.zip", 737 "js_templates.zip", 738 ], 739} 740 741python_binary_host { 742 name: "mojom_generate_type_mappings", 743 main: "libchrome_tools/mojom_generate_type_mappings.py", 744 srcs: [ 745 "build/gn_helpers.py", 746 "libchrome_tools/mojom_generate_type_mappings.py", 747 "mojo/public/tools/bindings/generate_type_mappings.py", 748 "mojo/public/tools/bindings/pylib/mojom/fileutil.py", 749 "mojo/public/tools/bindings/pylib/mojom/generate/generator.py", 750 "mojo/public/tools/bindings/pylib/mojom/generate/module.py", 751 "mojo/public/tools/bindings/pylib/mojom/generate/pack.py", 752 ], 753 defaults: ["libmojo_scripts"], 754} 755 756genrule { 757 name: "libmojo_common_custom_types__type_mappings", 758 cmd: "$(location mojom_generate_type_mappings)" + 759 " --output=$(out)" + 760 " $(in)", 761 762 tools: ["mojom_generate_type_mappings"], 763 764 srcs: [ 765 "mojo/public/cpp/base/big_buffer.typemap", 766 "mojo/public/cpp/base/big_string.typemap", 767 "mojo/public/cpp/base/file.typemap", 768 "mojo/public/cpp/base/file_error.typemap", 769 "mojo/public/cpp/base/file_info.typemap", 770 "mojo/public/cpp/base/file_path.typemap", 771 "mojo/public/cpp/base/process_id.typemap", 772 "mojo/public/cpp/base/read_only_buffer.typemap", 773 "mojo/public/cpp/base/ref_counted_memory.typemap", 774 "mojo/public/cpp/base/shared_memory.typemap", 775 "mojo/public/cpp/base/string16.typemap", 776 "mojo/public/cpp/base/text_direction.typemap", 777 "mojo/public/cpp/base/thread_priority.typemap", 778 "mojo/public/cpp/base/time.typemap", 779 "mojo/public/cpp/base/unguessable_token.typemap", 780 "mojo/public/cpp/base/values.typemap", 781 "ui/gfx/geometry/mojo/geometry.typemap", 782 "ui/gfx/range/mojo/range.typemap", 783 ], 784 out: ["common_custom_types__type_mappings"], 785} 786 787generate_mojom_pickles { 788 name: "libmojo_mojom_pickles", 789 srcs: [":libmojo_mojom_files"], 790} 791 792generate_mojom_headers { 793 name: "libmojo_mojom_headers", 794 srcs: [":libmojo_mojom_files"], 795 pickles: [":libmojo_mojom_pickles"], 796 templates: ":libmojo_mojom_templates", 797 flags: "--disallow_native_types", 798 typemaps: [":libmojo_common_custom_types__type_mappings"], 799} 800 801generate_mojom_srcs { 802 name: "libmojo_mojom_srcs", 803 srcs: [":libmojo_mojom_files"], 804 pickles: [":libmojo_mojom_pickles"], 805 templates: ":libmojo_mojom_templates", 806 flags: "--disallow_native_types", 807 typemaps: [":libmojo_common_custom_types__type_mappings"], 808} 809 810genrule { 811 name: "libmojo_jni_headers", 812 cmd: "$(location libchrome_tools/jni_generator_helper.sh)" + 813 " --jni_generator=$(location jni_generator)" + 814 " --output_dir=$(genDir)/jni" + 815 " --includes=base/android/jni_generator/jni_generator_helper.h" + 816 " --ptr_type=long" + 817 " $(in)", 818 819 tools: [ 820 "jni_generator", 821 ], 822 823 tool_files: [ 824 "libchrome_tools/jni_generator_helper.sh", 825 ], 826 827 srcs: [ 828 "base/android/java/src/org/chromium/base/BuildInfo.java", 829 "base/android/java/src/org/chromium/base/JavaExceptionReporter.java", 830 "base/android/java/src/org/chromium/base/ThreadUtils.java", 831 "mojo/public/java/system/src/org/chromium/mojo/system/impl/BaseRunLoop.java", 832 "mojo/public/java/system/src/org/chromium/mojo/system/impl/CoreImpl.java", 833 "mojo/public/java/system/src/org/chromium/mojo/system/impl/WatcherImpl.java", 834 ], 835 836 out: [ 837 "jni/BaseRunLoop_jni.h", 838 "jni/BuildInfo_jni.h", 839 "jni/CoreImpl_jni.h", 840 "jni/JavaExceptionReporter_jni.h", 841 "jni/WatcherImpl_jni.h", 842 ], 843} 844 845genrule { 846 name: "libmojo_jni_registration_headers", 847 cmd: "$(location libchrome_tools/jni_registration_generator_helper.sh)" + 848 " --jni_generator=$(location jni_registration_generator)" + 849 " --output=$(genDir)/jni/libmojo_jni_registrations.h" + 850 " $(in)", 851 852 tools: [ 853 "jni_registration_generator", 854 ], 855 856 tool_files: [ 857 "libchrome_tools/jni_registration_generator_helper.sh", 858 ], 859 860 srcs: [ 861 "base/android/java/src/org/chromium/base/BuildInfo.java", 862 "base/android/java/src/org/chromium/base/JavaExceptionReporter.java", 863 "base/android/java/src/org/chromium/base/ThreadUtils.java", 864 "mojo/public/java/system/src/org/chromium/mojo/system/impl/BaseRunLoop.java", 865 "mojo/public/java/system/src/org/chromium/mojo/system/impl/CoreImpl.java", 866 "mojo/public/java/system/src/org/chromium/mojo/system/impl/WatcherImpl.java", 867 ], 868 869 out: [ 870 "jni/libmojo_jni_registrations.h", 871 ], 872} 873 874cc_library_shared { 875 name: "libmojo", 876 vendor_available: true, 877 878 generated_sources: ["libmojo_mojom_srcs"], 879 generated_headers: [ 880 "libmojo_jni_headers", 881 "libmojo_jni_registration_headers", 882 "libmojo_mojom_headers", 883 ], 884 export_generated_headers: [ 885 "libmojo_jni_registration_headers", 886 "libmojo_mojom_headers", 887 ], 888 889 srcs: [ 890 ":libmojo_mojo_sources", 891 "base/android/build_info.cc", 892 "base/android/java_exception_reporter.cc", 893 "base/android/jni_android.cc", 894 "base/android/jni_array.cc", 895 "base/android/jni_string.cc", 896 "base/android/scoped_java_ref.cc", 897 "ipc/ipc_message.cc", 898 "ipc/ipc_message_attachment.cc", 899 "ipc/ipc_message_attachment_set.cc", 900 "ipc/ipc_message_utils.cc", 901 "ipc/ipc_mojo_handle_attachment.cc", 902 "ipc/ipc_mojo_message_helper.cc", 903 "ipc/ipc_mojo_param_traits.cc", 904 "ipc/ipc_platform_file_attachment_posix.cc", 905 "ipc/native_handle_type_converters.cc", 906 ], 907 908 cflags: [ 909 "-DMOJO_CORE_LEGACY_PROTOCOL", 910 "-Wall", 911 "-Werror", 912 "-Wno-missing-field-initializers", 913 "-Wno-unused-parameter", 914 ], 915 916 // We also pass NO_ASHMEM to make base::SharedMemory avoid using it and prefer 917 // the POSIX versions. 918 cppflags: [ 919 "-DNO_ASHMEM", 920 "-Wno-extra", 921 "-Wno-ignored-qualifiers", 922 "-Wno-non-virtual-dtor", 923 "-Wno-sign-promo", 924 ], 925 926 shared_libs: [ 927 "libchrome", 928 "libchrome-crypto", 929 "libevent", 930 "liblog", 931 ], 932 933 header_libs: ["jni_headers"], 934 935 export_include_dirs: ["."], 936} 937 938generate_mojom_srcjar { 939 name: "libmojo_mojom_java_srcs", 940 srcs: [":libmojo_mojom_files"], 941 pickles: [":libmojo_mojom_pickles"], 942 srcjar: "libmojo_mojom.srcjar", 943 templates: ":libmojo_mojom_templates", 944 flags: "--disallow_native_types", 945 typemaps: [":libmojo_common_custom_types__type_mappings"], 946} 947 948java_library { 949 name: "android.mojo", 950 951 srcs: [ 952 ":libmojo_mojom_java_srcs", 953 "base/android/java/src/**/*.java", 954 "mojo/android/system/src/**/*.java", 955 "mojo/public/java/bindings/src/**/*.java", 956 "mojo/public/java/system/src/**/*.java", 957 ], 958 959 static_libs: [ 960 "android-support-annotations", 961 ], 962} 963