Home | History | Annotate | Download | only in libchrome
      1 #
      2 #  Copyright (C) 2015 Google, Inc.
      3 #
      4 #  Licensed under the Apache License, Version 2.0 (the "License");
      5 #  you may not use this file except in compliance with the License.
      6 #  You may obtain a copy of the License at:
      7 #
      8 #  http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 #  Unless required by applicable law or agreed to in writing, software
     11 #  distributed under the License is distributed on an "AS IS" BASIS,
     12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 #  See the License for the specific language governing permissions and
     14 #  limitations under the License.
     15 #
     16 
     17 source_set("base_sources") {
     18   sources = [
     19     "base/at_exit.cc",
     20     "base/atomic_ref_count.h",
     21     "base/atomic_sequence_num.h",
     22     "base/atomicops.h",
     23     "base/base64.cc",
     24     "base/base64.h",
     25     "base/base_export.h",
     26     "base/base_switches.cc",
     27     "base/bind_helpers.cc",
     28     "base/build_time.cc",
     29     "base/callback_helpers.cc",
     30     "base/callback_internal.cc",
     31     "base/command_line.cc",
     32     "base/cpu.cc",
     33     "base/debug/alias.cc",
     34     "base/debug/debugger.cc",
     35     "base/debug/debugger_posix.cc",
     36     "base/debug/stack_trace.cc",
     37     "base/debug/stack_trace_posix.cc",
     38     "base/debug/task_annotator.cc",
     39     "base/environment.cc",
     40     "base/files/file.cc",
     41     "base/files/file_enumerator.cc",
     42     "base/files/file_enumerator_posix.cc",
     43     "base/files/file_path.cc",
     44     "base/files/file_path_constants.cc",
     45     "base/files/file_path_watcher.cc",
     46     "base/files/file_path_watcher_linux.cc",
     47     "base/files/file_posix.cc",
     48     "base/files/file_tracing.cc",
     49     "base/files/file_util.cc",
     50     "base/files/file_util_linux.cc",
     51     "base/files/file_util_posix.cc",
     52     "base/files/important_file_writer.cc",
     53     "base/files/scoped_file.cc",
     54     "base/files/scoped_temp_dir.cc",
     55     "base/guid.cc",
     56     "base/guid_posix.cc",
     57     "base/json/json_parser.cc",
     58     "base/json/json_reader.cc",
     59     "base/json/json_string_value_serializer.cc",
     60     "base/json/json_writer.cc",
     61     "base/json/string_escape.cc",
     62     "base/lazy_instance.cc",
     63     "base/location.cc",
     64     "base/logging.cc",
     65     "base/md5.cc",
     66     "base/memory/ref_counted.cc",
     67     "base/memory/ref_counted_memory.cc",
     68     "base/memory/singleton.cc",
     69     "base/memory/weak_ptr.cc",
     70     "base/message_loop/incoming_task_queue.cc",
     71     "base/message_loop/message_loop.cc",
     72     "base/message_loop/message_loop_task_runner.cc",
     73     "base/message_loop/message_pump.cc",
     74     "base/message_loop/message_pump_default.cc",
     75 
     76     # we don't want any glib dependencies.
     77     #   "base/message_loop/message_pump_glib.cc",
     78     "base/message_loop/message_pump_libevent.cc",
     79     "base/metrics/bucket_ranges.cc",
     80     "base/metrics/field_trial.cc",
     81     "base/metrics/metrics_hashes.cc",
     82     "base/metrics/histogram_base.cc",
     83     "base/metrics/histogram.cc",
     84     "base/metrics/histogram_samples.cc",
     85     "base/metrics/histogram_snapshot_manager.cc",
     86     "base/metrics/sample_map.cc",
     87     "base/metrics/sample_vector.cc",
     88     "base/metrics/sparse_histogram.cc",
     89     "base/metrics/statistics_recorder.cc",
     90     "base/pending_task.cc",
     91     "base/pickle.cc",
     92     "base/posix/file_descriptor_shuffle.cc",
     93     "base/posix/safe_strerror.cc",
     94     "base/posix/unix_domain_socket_linux.cc",
     95     "base/process/internal_linux.cc",
     96     "base/process/kill.cc",
     97     "base/process/kill_posix.cc",
     98     "base/process/launch.cc",
     99     "base/process/launch_posix.cc",
    100     "base/process/process_handle_linux.cc",
    101     "base/process/process_handle_posix.cc",
    102     "base/process/process_iterator.cc",
    103     "base/process/process_iterator_linux.cc",
    104     "base/process/process_metrics.cc",
    105     "base/process/process_metrics_linux.cc",
    106     "base/process/process_metrics_posix.cc",
    107     "base/process/process_posix.cc",
    108     "base/profiler/alternate_timer.cc",
    109     "base/profiler/scoped_profile.cc",
    110     "base/profiler/scoped_tracker.cc",
    111     "base/profiler/tracked_time.cc",
    112     "base/rand_util.cc",
    113     "base/rand_util_posix.cc",
    114     "base/run_loop.cc",
    115     "base/sequence_checker_impl.cc",
    116     "base/sequenced_task_runner.cc",
    117     "base/sha1_portable.cc",
    118     "base/strings/pattern.cc",
    119     "base/strings/safe_sprintf.cc",
    120     "base/strings/string16.cc",
    121     "base/strings/string_number_conversions.cc",
    122     "base/strings/string_piece.cc",
    123     "base/strings/stringprintf.cc",
    124     "base/strings/string_split.cc",
    125     "base/strings/string_util.cc",
    126     "base/strings/string_util_constants.cc",
    127     "base/strings/sys_string_conversions_posix.cc",
    128     "base/strings/utf_string_conversions.cc",
    129     "base/strings/utf_string_conversion_utils.cc",
    130     "base/synchronization/cancellation_flag.cc",
    131     "base/synchronization/condition_variable_posix.cc",
    132     "base/synchronization/lock.cc",
    133     "base/synchronization/lock_impl_posix.cc",
    134     "base/synchronization/waitable_event_posix.cc",
    135     "base/sync_socket_posix.cc",
    136     "base/sys_info.cc",
    137 
    138     # TODO(armansito): For our GN builds these platform-specific implementations
    139     # don't really make that much sense but instead of removing the line I'm
    140     # commenting it out in case we want to re-add it later (it's included in the
    141     # libchrome Android.mk).
    142     #"sys_info_chromeos.cc",
    143     "base/sys_info_linux.cc",
    144     "base/sys_info_posix.cc",
    145     "base/task/cancelable_task_tracker.cc",
    146     "base/task_runner.cc",
    147     "base/third_party/icu/icu_utf.cc",
    148     "base/third_party/nspr/prtime.cc",
    149     "base/threading/non_thread_safe_impl.cc",
    150     "base/threading/platform_thread_internal_posix.cc",
    151     "base/threading/platform_thread_linux.cc",
    152     "base/threading/platform_thread_posix.cc",
    153     "base/threading/post_task_and_reply_impl.cc",
    154     "base/threading/sequenced_worker_pool.cc",
    155     "base/threading/simple_thread.cc",
    156     "base/threading/thread.cc",
    157     "base/threading/thread_checker_impl.cc",
    158     "base/threading/thread_collision_warner.cc",
    159     "base/threading/thread_id_name_manager.cc",
    160     "base/threading/thread_local_posix.cc",
    161     "base/threading/thread_local_storage.cc",
    162     "base/threading/thread_local_storage_posix.cc",
    163     "base/threading/thread_restrictions.cc",
    164     "base/threading/worker_pool.cc",
    165     "base/threading/worker_pool_posix.cc",
    166     "base/thread_task_runner_handle.cc",
    167     "base/time/clock.cc",
    168     "base/time/default_clock.cc",
    169     "base/time/default_tick_clock.cc",
    170     "base/timer/elapsed_timer.cc",
    171     "base/timer/timer.cc",
    172     "base/time/tick_clock.cc",
    173     "base/time/time.cc",
    174     "base/time/time_posix.cc",
    175     "base/trace_event/heap_profiler_allocation_context.cc",
    176     "base/trace_event/heap_profiler_allocation_context_tracker.cc",
    177     "base/trace_event/heap_profiler_stack_frame_deduplicator.cc",
    178     "base/trace_event/heap_profiler_type_name_deduplicator.cc",
    179     "base/trace_event/malloc_dump_provider.cc",
    180     "base/trace_event/memory_allocator_dump.cc",
    181     "base/trace_event/memory_allocator_dump_guid.cc",
    182     "base/trace_event/memory_dump_manager.cc",
    183     "base/trace_event/memory_dump_session_state.cc",
    184     "base/trace_event/process_memory_dump.cc",
    185     "base/trace_event/process_memory_maps.cc",
    186     "base/trace_event/process_memory_maps_dump_provider.cc",
    187     "base/trace_event/process_memory_totals.cc",
    188     "base/trace_event/process_memory_totals_dump_provider.cc",
    189     "base/trace_event/trace_buffer.cc",
    190     "base/trace_event/trace_config.cc",
    191     "base/trace_event/trace_event_argument.cc",
    192     "base/trace_event/trace_event_impl.cc",
    193     "base/trace_event/trace_event_memory_overhead.cc",
    194     "base/trace_event/trace_event_synthetic_delay.cc",
    195     "base/trace_event/trace_log.cc",
    196     "base/trace_event/trace_log_constants.cc",
    197     "base/trace_event/trace_sampling_thread.cc",
    198     "base/tracked_objects.cc",
    199     "base/tracking_info.cc",
    200     "base/values.cc",
    201     "base/vlog.cc",
    202   ]
    203 
    204   defines = [
    205     "BASE_IMPLEMENTATION",
    206 
    207     # trick libchrome to think we're building host code within an Android checkout
    208     # thanks to it no glib dependency
    209     "__ANDROID_HOST__=1",
    210     "OS_LINUX=1",
    211   ]
    212 
    213   include_dirs = [
    214     "//",
    215     "//third_party/googletest/googletest/include",
    216     "//third_party/libchrome",
    217     "//third_party/libevent",
    218     "//third_party/libevent/include",
    219     "//third_party/libchrome/base",
    220     "//third_party/modp_b64",
    221   ]
    222 }
    223 
    224 config("libchrome_config") {
    225   # libchrome headers need to be able to find themselves.
    226   include_dirs = [
    227     "//third_party/googletest/googletest/include",
    228     "//third_party/libchrome",
    229  ]
    230 }
    231 
    232 static_library("base") {
    233   deps = [
    234     ":base_sources",
    235   ]
    236 
    237   cflags = [
    238     "-Wno-char-subscripts",
    239     "-Wno-missing-field-initializers",
    240     "-Wno-unused-function",
    241     "-Wno-unused_parameter",
    242   ]
    243   cflags_cc = [
    244     "-Wno-deprecated-register",
    245     "-Wno-non-virtual-dtor",
    246     "-Wno-sign-promo",
    247   ]
    248 
    249   libs = [
    250     "-levent",
    251     "-levent_core",
    252     "-lpthread",
    253   ]
    254 
    255   public_configs = [ ":libchrome_config" ]
    256 }
    257