# # Copyright 2015 Google, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # source_set("base_sources") { sources = [ "base/at_exit.cc", "base/atomic_ref_count.h", "base/atomic_sequence_num.h", "base/atomicops.h", "base/base64.cc", "base/base64.h", "base/base_export.h", "base/base_switches.cc", "base/build_time.cc", "base/callback_helpers.cc", "base/callback_internal.cc", "base/command_line.cc", "base/cpu.cc", "base/debug/activity_tracker.cc", "base/debug/alias.cc", "base/debug/dump_without_crashing.cc", "base/debug/debugger.cc", "base/debug/debugger_posix.cc", "base/debug/stack_trace.cc", "base/debug/stack_trace_posix.cc", "base/debug/task_annotator.cc", "base/environment.cc", "base/files/file.cc", "base/files/file_descriptor_watcher_posix.cc", "base/files/file_enumerator.cc", "base/files/file_enumerator_posix.cc", "base/files/file_path.cc", "base/files/file_path_constants.cc", "base/files/file_path_watcher.cc", "base/files/file_path_watcher_linux.cc", "base/files/file_posix.cc", "base/files/file_tracing.cc", "base/files/file_util.cc", "base/files/file_util_linux.cc", "base/files/file_util_posix.cc", "base/files/important_file_writer.cc", "base/files/scoped_file.cc", "base/files/scoped_temp_dir.cc", "base/guid.cc", "base/json/json_parser.cc", "base/json/json_reader.cc", "base/json/json_string_value_serializer.cc", "base/json/json_writer.cc", "base/json/string_escape.cc", "base/lazy_instance_helpers.cc", "base/location.cc", "base/logging.cc", "base/md5.cc", "base/memory/ref_counted.cc", "base/memory/ref_counted_memory.cc", "base/memory/weak_ptr.cc", "base/message_loop/incoming_task_queue.cc", "base/message_loop/message_loop.cc", "base/message_loop/message_loop_current.cc", "base/message_loop/message_loop_task_runner.cc", "base/message_loop/message_pump.cc", "base/message_loop/message_pump_default.cc", "base/message_loop/message_pump_libevent.cc", "base/message_loop/watchable_io_message_pump_posix.cc", # we don't want any glib dependencies. # "base/message_loop/message_pump_glib.cc", "base/metrics/bucket_ranges.cc", "base/metrics/dummy_histogram.cc", "base/metrics/field_trial.cc", "base/metrics/field_trial_param_associator.cc", "base/metrics/histogram.cc", "base/metrics/histogram_base.cc", "base/metrics/histogram_functions.cc", "base/metrics/histogram_samples.cc", "base/metrics/histogram_snapshot_manager.cc", "base/metrics/metrics_hashes.cc", "base/metrics/persistent_histogram_allocator.cc", "base/metrics/persistent_memory_allocator.cc", "base/metrics/persistent_sample_map.cc", "base/metrics/sample_map.cc", "base/metrics/sample_vector.cc", "base/metrics/sparse_histogram.cc", "base/metrics/statistics_recorder.cc", "base/native_library.cc", "base/observer_list_threadsafe.cc", "base/path_service.cc", "base/pending_task.cc", "base/pickle.cc", "base/posix/file_descriptor_shuffle.cc", "base/posix/global_descriptors.cc", "base/posix/safe_strerror.cc", "base/process/internal_linux.cc", "base/process/kill.cc", "base/process/kill_posix.cc", "base/process/launch.cc", "base/process/launch_posix.cc", "base/process/memory.cc", "base/process/process_handle.cc", "base/process/process_handle_linux.cc", "base/process/process_handle_posix.cc", "base/process/process_info_linux.cc", "base/process/process_iterator.cc", "base/process/process_iterator_linux.cc", "base/process/process_metrics.cc", "base/process/process_metrics_linux.cc", "base/process/process_metrics_posix.cc", "base/process/process_posix.cc", "base/rand_util.cc", "base/rand_util_posix.cc", "base/run_loop.cc", "base/sequence_checker_impl.cc", "base/sequenced_task_runner.cc", "base/sequence_token.cc", "base/sha1.cc", "base/strings/pattern.cc", "base/strings/safe_sprintf.cc", "base/strings/string16.cc", "base/strings/string_number_conversions.cc", "base/strings/string_piece.cc", "base/strings/stringprintf.cc", "base/strings/string_split.cc", "base/strings/string_util.cc", "base/strings/string_util_constants.cc", "base/strings/sys_string_conversions_posix.cc", "base/strings/utf_string_conversions.cc", "base/strings/utf_string_conversion_utils.cc", "base/synchronization/atomic_flag.cc", "base/synchronization/condition_variable_posix.cc", "base/synchronization/lock.cc", "base/synchronization/lock_impl_posix.cc", "base/synchronization/waitable_event_posix.cc", "base/sync_socket_posix.cc", "base/sys_info.cc", # TODO(armansito): For our GN builds these platform-specific implementations # don't really make that much sense but instead of removing the line I'm # commenting it out in case we want to re-add it later (it's included in the # libchrome Android.mk). #"sys_info_chromeos.cc", "base/sys_info_linux.cc", "base/sys_info_posix.cc", "base/task/cancelable_task_tracker.cc", "base/task_runner.cc", "base/third_party/icu/icu_utf.cc", "base/third_party/nspr/prtime.cc", "base/threading/platform_thread_internal_posix.cc", "base/threading/platform_thread_linux.cc", "base/threading/platform_thread_posix.cc", "base/threading/post_task_and_reply_impl.cc", "base/threading/scoped_blocking_call.cc", "base/threading/sequence_local_storage_map.cc", "base/threading/sequence_local_storage_slot.cc", "base/threading/sequenced_task_runner_handle.cc", "base/threading/simple_thread.cc", "base/threading/thread.cc", "base/threading/thread_checker_impl.cc", "base/threading/thread_collision_warner.cc", "base/threading/thread_id_name_manager.cc", "base/threading/thread_local_storage.cc", "base/threading/thread_local_storage_posix.cc", "base/threading/thread_restrictions.cc", "base/threading/thread_task_runner_handle.cc", "base/time/clock.cc", "base/time/default_clock.cc", "base/time/default_tick_clock.cc", "base/time/tick_clock.cc", "base/time/time.cc", "base/time/time_conversion_posix.cc", "base/time/time_exploded_posix.cc", "base/time/time_now_posix.cc", "base/time/time_override.cc", "base/timer/elapsed_timer.cc", "base/timer/timer.cc", "base/unguessable_token.cc", "base/value_iterators.cc", "base/values.cc", "base/version.cc", "base/vlog.cc", "dbus/bus.cc", "dbus/dbus_statistics.cc", "dbus/exported_object.cc", "dbus/message.cc", "dbus/object_manager.cc", "dbus/object_path.cc", "dbus/object_proxy.cc", "dbus/property.cc", "dbus/scoped_dbus_error.cc", "dbus/string_util.cc", "dbus/util.cc", "dbus/values_util.cc" ] defines = [ "BASE_IMPLEMENTATION", # trick libchrome to think we're building host code within an Android checkout # thanks to it no glib dependency "__ANDROID_HOST__=1", "OS_LINUX=1", ] include_dirs = [ "//", "//third_party/googletest/googletest/include", "//third_party/libchrome", "//third_party/libevent", "//third_party/libevent/include", "//third_party/libchrome/base", "//third_party/libchrome/dbus", "//third_party/modp_b64", # paths to dbus headers, can be obtained by "pkg-config --cflags dbus-1" #TODO(jpawlowski) use pkg-config script like build/config/linux/pkg_config.gni "/usr/include/dbus-1.0/", "/usr/lib/x86_64-linux-gnu/dbus-1.0/include", ] } config("libchrome_config") { # libchrome headers need to be able to find themselves. include_dirs = [ "//third_party/googletest/googletest/include", "//third_party/libchrome", # paths to dbus headers, can be obtained by "pkg-config --cflags dbus-1" #TODO(jpawlowski) use pkg-config script like build/config/linux/pkg_config.gni "/usr/include/dbus-1.0/", "/usr/lib/x86_64-linux-gnu/dbus-1.0/include", ] } static_library("base") { deps = [ ":base_sources", ] cflags = [ "-Wno-char-subscripts", "-Wno-missing-field-initializers", "-Wno-unused-function", "-Wno-unused_parameter", ] cflags_cc = [ "-Wno-deprecated-register", "-Wno-non-virtual-dtor", "-Wno-sign-promo", ] libs = [ "-levent", "-levent_core", "-lpthread", "-ldbus-1", ] public_configs = [ ":libchrome_config" ] }