330 lines
9.3 KiB
Plaintext
330 lines
9.3 KiB
Plaintext
// Copyright (C) 2017 The Android Open Source Project
|
|
//
|
|
// 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.
|
|
|
|
// Default values for the USE flags. Override these USE flags from your product
|
|
// by setting BRILLO_USE_* values. Note that we define local variables like
|
|
// local_use_* to prevent leaking our default setting for other packages.
|
|
|
|
package {
|
|
default_applicable_licenses: ["external_libbrillo_license"],
|
|
}
|
|
|
|
// Added automatically by a large-scale-change that took the approach of
|
|
// 'apply every license found to every target'. While this makes sure we respect
|
|
// every license restriction, it may not be entirely correct.
|
|
//
|
|
// e.g. GPL in an MIT project might only apply to the contrib/ directory.
|
|
//
|
|
// Please consider splitting the single license below into multiple licenses,
|
|
// taking care not to lose any license_kind information, and overriding the
|
|
// default license using the 'licenses: [...]' property on targets as needed.
|
|
//
|
|
// For unused files, consider creating a 'fileGroup' with "//visibility:private"
|
|
// to attach the license to, and including a comment whether the files may be
|
|
// used in the current project.
|
|
// See: http://go/android-license-faq
|
|
license {
|
|
name: "external_libbrillo_license",
|
|
visibility: [":__subpackages__"],
|
|
license_kinds: [
|
|
"SPDX-license-identifier-Apache-2.0",
|
|
"SPDX-license-identifier-BSD",
|
|
],
|
|
license_text: [
|
|
"NOTICE",
|
|
],
|
|
}
|
|
|
|
libbrillo_core_sources = [
|
|
"brillo/backoff_entry.cc",
|
|
"brillo/data_encoding.cc",
|
|
"brillo/errors/error.cc",
|
|
"brillo/errors/error_codes.cc",
|
|
"brillo/flag_helper.cc",
|
|
"brillo/key_value_store.cc",
|
|
"brillo/message_loops/base_message_loop.cc",
|
|
"brillo/message_loops/message_loop.cc",
|
|
"brillo/message_loops/message_loop_utils.cc",
|
|
"brillo/mime_utils.cc",
|
|
"brillo/osrelease_reader.cc",
|
|
"brillo/process.cc",
|
|
"brillo/process_information.cc",
|
|
"brillo/secure_blob.cc",
|
|
"brillo/strings/string_utils.cc",
|
|
"brillo/syslog_logging.cc",
|
|
"brillo/type_name_undecorate.cc",
|
|
"brillo/url_utils.cc",
|
|
"brillo/userdb_utils.cc",
|
|
"brillo/value_conversion.cc",
|
|
]
|
|
|
|
libbrillo_linux_sources = [
|
|
"brillo/asynchronous_signal_handler.cc",
|
|
"brillo/daemons/daemon.cc",
|
|
"brillo/file_utils.cc",
|
|
"brillo/process_reaper.cc",
|
|
]
|
|
|
|
libbrillo_binder_sources = ["brillo/binder_watcher.cc"]
|
|
|
|
libbrillo_http_sources = [
|
|
"brillo/http/curl_api.cc",
|
|
"brillo/http/http_connection_curl.cc",
|
|
"brillo/http/http_form_data.cc",
|
|
"brillo/http/http_request.cc",
|
|
"brillo/http/http_transport.cc",
|
|
"brillo/http/http_transport_curl.cc",
|
|
"brillo/http/http_utils.cc",
|
|
]
|
|
|
|
libbrillo_policy_sources = [
|
|
"policy/device_policy.cc",
|
|
"policy/libpolicy.cc",
|
|
]
|
|
|
|
libbrillo_stream_sources = [
|
|
"brillo/streams/file_stream.cc",
|
|
"brillo/streams/input_stream_set.cc",
|
|
"brillo/streams/memory_containers.cc",
|
|
"brillo/streams/memory_stream.cc",
|
|
"brillo/streams/openssl_stream_bio.cc",
|
|
"brillo/streams/stream.cc",
|
|
"brillo/streams/stream_errors.cc",
|
|
"brillo/streams/stream_utils.cc",
|
|
"brillo/streams/tls_stream.cc",
|
|
]
|
|
|
|
libbrillo_test_helpers_sources = [
|
|
"brillo/http/http_connection_fake.cc",
|
|
"brillo/http/http_transport_fake.cc",
|
|
"brillo/message_loops/fake_message_loop.cc",
|
|
"brillo/streams/fake_stream.cc",
|
|
"brillo/unittest_utils.cc",
|
|
]
|
|
|
|
libbrillo_test_sources = [
|
|
"brillo/asynchronous_signal_handler_test.cc",
|
|
"brillo/backoff_entry_test.cc",
|
|
"brillo/data_encoding_test.cc",
|
|
"brillo/enum_flags_test.cc",
|
|
"brillo/errors/error_codes_test.cc",
|
|
"brillo/errors/error_test.cc",
|
|
"brillo/file_utils_test.cc",
|
|
"brillo/flag_helper_test.cc",
|
|
"brillo/http/http_connection_curl_test.cc",
|
|
"brillo/http/http_form_data_test.cc",
|
|
"brillo/http/http_request_test.cc",
|
|
"brillo/http/http_transport_curl_test.cc",
|
|
"brillo/http/http_utils_test.cc",
|
|
"brillo/key_value_store_test.cc",
|
|
"brillo/map_utils_test.cc",
|
|
"brillo/message_loops/base_message_loop_test.cc",
|
|
"brillo/message_loops/fake_message_loop_test.cc",
|
|
"brillo/mime_utils_test.cc",
|
|
"brillo/osrelease_reader_test.cc",
|
|
"brillo/process_reaper_test.cc",
|
|
"brillo/process_test.cc",
|
|
"brillo/secure_blob_test.cc",
|
|
"brillo/streams/fake_stream_test.cc",
|
|
"brillo/streams/file_stream_test.cc",
|
|
"brillo/streams/input_stream_set_test.cc",
|
|
"brillo/streams/memory_containers_test.cc",
|
|
"brillo/streams/memory_stream_test.cc",
|
|
"brillo/streams/openssl_stream_bio_test.cc",
|
|
"brillo/streams/stream_test.cc",
|
|
"brillo/streams/stream_utils_test.cc",
|
|
"brillo/strings/string_utils_test.cc",
|
|
"brillo/unittest_utils.cc",
|
|
"brillo/url_utils_test.cc",
|
|
"brillo/value_conversion_test.cc",
|
|
]
|
|
|
|
libbrillo_CFLAGS = [
|
|
"-Wall",
|
|
"-Werror",
|
|
"-Wno-non-virtual-dtor",
|
|
"-Wno-unused-parameter",
|
|
"-Wno-unused-variable",
|
|
]
|
|
|
|
libbrillo_shared_libraries = ["libchrome"]
|
|
|
|
// Main library, shared and static for host and target
|
|
// ========================================================
|
|
cc_library {
|
|
name: "libbrillo",
|
|
host_supported: true,
|
|
recovery_available: true,
|
|
srcs: libbrillo_core_sources,
|
|
shared_libs: libbrillo_shared_libraries,
|
|
static_libs: [
|
|
"libmodpb64",
|
|
],
|
|
header_libs: ["libgtest_prod_headers"],
|
|
cflags: libbrillo_CFLAGS,
|
|
export_include_dirs: ["."],
|
|
|
|
target: {
|
|
host: {
|
|
cppflags: ["-D__ANDROID_HOST__"],
|
|
},
|
|
android: {
|
|
srcs: libbrillo_linux_sources,
|
|
},
|
|
darwin: {
|
|
enabled: false
|
|
}
|
|
},
|
|
}
|
|
|
|
// Shared binder library for target
|
|
// ========================================================
|
|
cc_library_shared {
|
|
name: "libbrillo-binder",
|
|
srcs: libbrillo_binder_sources,
|
|
shared_libs: libbrillo_shared_libraries + [
|
|
"libbinder",
|
|
"libbrillo",
|
|
"libutils",
|
|
],
|
|
header_libs: ["libgtest_prod_headers"],
|
|
cflags: libbrillo_CFLAGS,
|
|
export_include_dirs: ["."],
|
|
}
|
|
|
|
// Shared minijail library for target
|
|
// ========================================================
|
|
cc_library_shared {
|
|
name: "libbrillo-minijail",
|
|
srcs: [
|
|
"brillo/minijail/minijail.cc",
|
|
],
|
|
shared_libs: [
|
|
"libchrome",
|
|
"libbrillo",
|
|
"libminijail",
|
|
],
|
|
header_libs: ["libgtest_prod_headers"],
|
|
cflags: libbrillo_CFLAGS,
|
|
export_include_dirs: ["."],
|
|
}
|
|
|
|
// Shared and static stream library for target and host
|
|
// ========================================================
|
|
cc_library {
|
|
name: "libbrillo-stream",
|
|
srcs: libbrillo_stream_sources,
|
|
shared_libs: libbrillo_shared_libraries + [
|
|
"libbrillo",
|
|
"libcrypto",
|
|
"libssl",
|
|
],
|
|
header_libs: ["libgtest_prod_headers"],
|
|
cflags: libbrillo_CFLAGS,
|
|
export_include_dirs: ["."],
|
|
|
|
host_supported: true,
|
|
recovery_available: true,
|
|
target: {
|
|
darwin: {
|
|
enabled: false,
|
|
},
|
|
windows: {
|
|
enabled: false,
|
|
},
|
|
},
|
|
}
|
|
|
|
// Shared http library for target and host
|
|
// ========================================================
|
|
cc_library_shared {
|
|
name: "libbrillo-http",
|
|
srcs: libbrillo_http_sources,
|
|
shared_libs: libbrillo_shared_libraries + [
|
|
"libbrillo",
|
|
"libbrillo-stream",
|
|
"libcurl",
|
|
],
|
|
header_libs: ["libgtest_prod_headers"],
|
|
cflags: libbrillo_CFLAGS,
|
|
export_include_dirs: ["."],
|
|
|
|
host_supported: true,
|
|
target: {
|
|
darwin: {
|
|
enabled: false,
|
|
},
|
|
windows: {
|
|
enabled: false,
|
|
},
|
|
},
|
|
}
|
|
|
|
// Shared policy library for target
|
|
// ========================================================
|
|
cc_library_shared {
|
|
name: "libbrillo-policy",
|
|
srcs: libbrillo_policy_sources,
|
|
shared_libs: libbrillo_shared_libraries,
|
|
header_libs: ["libgtest_prod_headers"],
|
|
cflags: libbrillo_CFLAGS,
|
|
export_include_dirs: ["."],
|
|
}
|
|
|
|
|
|
// Static test-helpers library for target
|
|
// ========================================================
|
|
cc_library_static {
|
|
name: "libbrillo-test-helpers",
|
|
srcs: libbrillo_test_helpers_sources,
|
|
static_libs: [
|
|
"libgtest",
|
|
"libgmock",
|
|
],
|
|
shared_libs: libbrillo_shared_libraries + [
|
|
"libbrillo",
|
|
"libcurl",
|
|
"libbrillo-http",
|
|
"libbrillo-stream",
|
|
"libcrypto",
|
|
],
|
|
cflags: libbrillo_CFLAGS,
|
|
cppflags: ["-Wno-sign-compare"],
|
|
export_include_dirs: ["."],
|
|
}
|
|
|
|
// Unit tests.
|
|
// ========================================================
|
|
cc_test {
|
|
name: "libbrillo_test",
|
|
srcs: libbrillo_test_sources,
|
|
isolated: true,
|
|
static_libs: [
|
|
"libgtest",
|
|
"libchrome_test_helpers",
|
|
"libbrillo-test-helpers",
|
|
"libgmock",
|
|
],
|
|
shared_libs: libbrillo_shared_libraries + [
|
|
"libbrillo",
|
|
"libcurl",
|
|
"libbrillo-http",
|
|
"libbrillo-stream",
|
|
"libcrypto",
|
|
"libprotobuf-cpp-lite",
|
|
],
|
|
cflags: libbrillo_CFLAGS,
|
|
cppflags: ["-Wno-sign-compare"],
|
|
}
|