1# Copyright 2015 The Chromium OS 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# TODO(lhchavez): Convert this to Android.bp 6LOCAL_PATH:= $(call my-dir) 7 8# Build native shared library. 9include $(CLEAR_VARS) 10 11LOCAL_MODULE_CLASS := SHARED_LIBRARIES 12LOCAL_MODULE := libmojo 13LOCAL_MODULE_TAGS := optional 14LOCAL_CPP_EXTENSION := .cc 15 16LOCAL_MOJOM_FILES := \ 17 mojo/common/common_custom_types.mojom \ 18 mojo/common/string16.mojom \ 19 mojo/public/interfaces/bindings/interface_control_messages.mojom \ 20 mojo/public/interfaces/bindings/pipe_control_messages.mojom \ 21 22# This file was copied from out/Release in a Chrome checkout. 23# TODO(lhchavez): Generate this file instead of hardcoding it. 24LOCAL_MOJOM_TYPE_MAPPINGS := \ 25 gen/mojo/common/common_custom_types__type_mappings \ 26 27LOCAL_MOJOM_BINDINGS_GENERATOR_FLAGS := --use_new_wrapper_types 28 29# Prepares all necessary templates. 30include $(LOCAL_PATH)/build_mojom_templates.mk 31 32# Compiles all local mojom files. 33include $(LOCAL_PATH)/build_mojom.mk 34 35# Runtime.class is added (instead of Runtime.java that lives in libcore) since 36# the script that generates the JNI files does not handle compiling it well. 37LOCAL_JAVA_JNI_FILES := \ 38 base/android/java/src/org/chromium/base/BuildInfo.java \ 39 base/android/java/src/org/chromium/base/ContentUriUtils.java \ 40 base/android/java/src/org/chromium/base/ContextUtils.java \ 41 base/android/java/src/org/chromium/base/PathUtils.java \ 42 base/android/java/src/org/chromium/base/SystemMessageHandler.java \ 43 jni/java/lang/Runtime.class \ 44 mojo/android/system/src/org/chromium/mojo/system/impl/BaseRunLoop.java \ 45 mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java \ 46 47# Generate all JNI header files. 48include $(LOCAL_PATH)/build_generated_jni.mk 49 50LOCAL_SRC_FILES := \ 51 base/android/build_info.cc \ 52 base/android/content_uri_utils.cc \ 53 base/android/context_utils.cc \ 54 base/android/java_runtime.cc \ 55 base/android/jni_android.cc \ 56 base/android/jni_string.cc \ 57 base/android/path_utils.cc \ 58 base/android/scoped_java_ref.cc \ 59 base/base_paths.cc \ 60 base/base_paths_android.cc \ 61 base/debug/proc_maps_linux.cc \ 62 base/debug/stack_trace_android.cc \ 63 base/files/file_util_android.cc \ 64 base/message_loop/message_pump_android.cc \ 65 base/path_service.cc \ 66 base/threading/thread_local_android.cc \ 67 base/trace_event/java_heap_dump_provider_android.cc \ 68 base/trace_event/trace_event_android.cc \ 69 ipc/brokerable_attachment.cc \ 70 ipc/ipc_message.cc \ 71 ipc/ipc_message_attachment.cc \ 72 ipc/ipc_message_attachment_set.cc \ 73 ipc/ipc_message_utils.cc \ 74 ipc/ipc_mojo_handle_attachment.cc \ 75 ipc/ipc_mojo_message_helper.cc \ 76 ipc/ipc_mojo_param_traits.cc \ 77 ipc/ipc_platform_file_attachment_posix.cc \ 78 ipc/placeholder_brokerable_attachment.cc \ 79 mojo/android/system/base_run_loop.cc \ 80 mojo/android/system/core_impl.cc \ 81 mojo/edk/embedder/embedder.cc \ 82 mojo/common/common_custom_types_struct_traits.cc \ 83 mojo/edk/embedder/entrypoints.cc \ 84 mojo/edk/embedder/platform_channel_pair.cc \ 85 mojo/edk/embedder/platform_channel_pair_posix.cc \ 86 mojo/edk/embedder/platform_channel_utils_posix.cc \ 87 mojo/edk/embedder/platform_handle.cc \ 88 mojo/edk/embedder/platform_handle_utils_posix.cc \ 89 mojo/edk/embedder/platform_shared_buffer.cc \ 90 mojo/edk/system/awakable_list.cc \ 91 mojo/edk/system/broker_host_posix.cc \ 92 mojo/edk/system/broker_posix.cc \ 93 mojo/edk/system/channel.cc \ 94 mojo/edk/system/channel_posix.cc \ 95 mojo/edk/system/configuration.cc \ 96 mojo/edk/system/core.cc \ 97 mojo/edk/system/data_pipe_consumer_dispatcher.cc \ 98 mojo/edk/system/data_pipe_control_message.cc \ 99 mojo/edk/system/data_pipe_producer_dispatcher.cc \ 100 mojo/edk/system/dispatcher.cc \ 101 mojo/edk/system/handle_table.cc \ 102 mojo/edk/system/mapping_table.cc \ 103 mojo/edk/system/message_for_transit.cc \ 104 mojo/edk/system/message_pipe_dispatcher.cc \ 105 mojo/edk/system/node_channel.cc \ 106 mojo/edk/system/node_controller.cc \ 107 mojo/edk/system/platform_handle_dispatcher.cc \ 108 mojo/edk/system/ports/event.cc \ 109 mojo/edk/system/ports/message.cc \ 110 mojo/edk/system/ports/message_queue.cc \ 111 mojo/edk/system/ports/name.cc \ 112 mojo/edk/system/ports/node.cc \ 113 mojo/edk/system/ports/port.cc \ 114 mojo/edk/system/ports/port_ref.cc \ 115 mojo/edk/system/ports_message.cc \ 116 mojo/edk/system/request_context.cc \ 117 mojo/edk/system/shared_buffer_dispatcher.cc \ 118 mojo/edk/system/wait_set_dispatcher.cc \ 119 mojo/edk/system/waiter.cc \ 120 mojo/edk/system/watcher.cc \ 121 mojo/edk/system/watcher_set.cc \ 122 mojo/message_pump/handle_watcher.cc \ 123 mojo/message_pump/message_pump_mojo.cc \ 124 mojo/message_pump/time_helper.cc \ 125 mojo/public/c/system/thunks.cc \ 126 mojo/public/cpp/bindings/lib/array_internal.cc \ 127 mojo/public/cpp/bindings/lib/associated_group.cc \ 128 mojo/public/cpp/bindings/lib/associated_group_controller.cc \ 129 mojo/public/cpp/bindings/lib/bindings_internal.cc \ 130 mojo/public/cpp/bindings/lib/connector.cc \ 131 mojo/public/cpp/bindings/lib/control_message_handler.cc \ 132 mojo/public/cpp/bindings/lib/control_message_proxy.cc \ 133 mojo/public/cpp/bindings/lib/filter_chain.cc \ 134 mojo/public/cpp/bindings/lib/fixed_buffer.cc \ 135 mojo/public/cpp/bindings/lib/interface_endpoint_client.cc \ 136 mojo/public/cpp/bindings/lib/message.cc \ 137 mojo/public/cpp/bindings/lib/message_buffer.cc \ 138 mojo/public/cpp/bindings/lib/message_builder.cc \ 139 mojo/public/cpp/bindings/lib/message_filter.cc \ 140 mojo/public/cpp/bindings/lib/message_header_validator.cc \ 141 mojo/public/cpp/bindings/lib/multiplex_router.cc \ 142 mojo/public/cpp/bindings/lib/native_struct.cc \ 143 mojo/public/cpp/bindings/lib/native_struct_data.cc \ 144 mojo/public/cpp/bindings/lib/native_struct_serialization.cc \ 145 mojo/public/cpp/bindings/lib/no_interface.cc \ 146 mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc \ 147 mojo/public/cpp/bindings/lib/pipe_control_message_proxy.cc \ 148 mojo/public/cpp/bindings/lib/router.cc \ 149 mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.cc \ 150 mojo/public/cpp/bindings/lib/serialization_context.cc \ 151 mojo/public/cpp/bindings/lib/sync_handle_registry.cc \ 152 mojo/public/cpp/bindings/lib/sync_handle_watcher.cc \ 153 mojo/public/cpp/bindings/lib/validation_context.cc \ 154 mojo/public/cpp/bindings/lib/validation_errors.cc \ 155 mojo/public/cpp/bindings/lib/validation_util.cc \ 156 mojo/public/cpp/system/watcher.cc \ 157 158LOCAL_CFLAGS := \ 159 -Wno-unused-parameter \ 160 -Wno-missing-field-initializers \ 161 -DMOJO_EDK_LEGACY_PROTOCOL \ 162 163# We use OS_POSIX since we need to communicate with Chrome. 164# We also pass NO_ASHMEM to make base::SharedMemory avoid using it and prefer 165# the POSIX versions. 166LOCAL_CPPFLAGS := \ 167 -Wno-sign-promo \ 168 -Wno-non-virtual-dtor \ 169 -Wno-ignored-qualifiers \ 170 -Wno-extra \ 171 -DOS_POSIX \ 172 -DNO_ASHMEM \ 173 -DNO_TCMALLOC \ 174 175LOCAL_SHARED_LIBRARIES := libevent liblog libchrome libchrome-crypto 176 177LOCAL_C_INCLUDES := \ 178 external/gtest/include \ 179 180LOCAL_EXPORT_C_INCLUDE_DIRS += \ 181 external/gtest/include \ 182 $(LOCAL_PATH) \ 183 184include $(BUILD_SHARED_LIBRARY) 185 186# Build Java library. 187include $(CLEAR_VARS) 188 189LOCAL_MODULE := android.mojo 190LOCAL_MODULE_CLASS := JAVA_LIBRARIES 191 192# We manually add a few classes explicitly rather than using the 193# |all-java-files-under| macro because base/ includes some stuff that we don't 194# want to compile since it requires a lot of extra gyp-generated files 195LOCAL_SRC_FILES := \ 196 base/android/java/src/org/chromium/base/BuildInfo.java \ 197 base/android/java/src/org/chromium/base/ContextUtils.java \ 198 base/android/java/src/org/chromium/base/PackageUtils.java \ 199 base/android/java/src/org/chromium/base/VisibleForTesting.java \ 200 $(call all-java-files-under, mojo/android/system/src) \ 201 $(call all-java-files-under, mojo/public/java/system/src) \ 202 $(call all-java-files-under, mojo/public/java/bindings/src) \ 203 $(call all-java-files-under, base/android/java/src/org/chromium/base/annotations) \ 204 205# Adds all .mojom files Java sources to compilation. 206original_module_class := SHARED_LIBRARIES 207original_module := libmojo 208include $(LOCAL_PATH)/build_mojom_jar.mk 209 210include $(BUILD_STATIC_JAVA_LIBRARY) 211