blob: 8cd39cfb5c5054a1531ec455cf42c053a94df721 [file] [log] [blame]
// Copyright 2024 The Pigweed Authors
//
// 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
//
// https://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.
// To use this module:
//
// 1. Define your own local cc_library_static which includes
// pw_spi_linux_defaults in its defaults: and specifies the pw_assert and
// pw_log backends:
//
// cc_library_static {
// name: "my-personal-pw_spi_linux",
// defaults: ["pw_spi_linux_defaults"],
// header_libs: [
// "pw_assert_log_headers", // pw_assert backend
// ],
// static_libs: [
// "libpw_log_android", // pw_log backend
// ],
// }
//
// 2. Then use this library in your application:
//
// cc_binary {
// name: "my-spi-prog",
// srcs: ["src/main.cc"],
// static_libs: [
// "my-personal-pw_spi_linux",
// ],
// }
package {
default_applicable_licenses: ["external_pigweed_license"],
}
filegroup {
name: "pw_spi_linux_src_files",
srcs: [
"linux_spi.cc",
],
}
cc_library_headers {
name: "pw_spi_headers",
cpp_std: "c++20",
export_include_dirs: ["public"],
vendor_available: true,
host_supported: true,
}
cc_defaults {
name: "pw_spi_linux_defaults",
cpp_std: "c++20",
srcs: [
":pw_spi_linux_src_files",
],
header_libs: [
"pw_assert_headers", // NOTE: You must provide an assert backend.
"pw_chrono_include_dirs",
"pw_log_headers", // NOTE: You must provide a log backend.
"pw_preprocessor_headers",
"pw_result_headers",
"pw_span_headers",
"pw_spi_headers",
"pw_sync_headers",
"pw_sync_binary_semaphore_thread_notification_backend_headers",
],
export_header_lib_headers: [
"pw_assert_headers",
"pw_log_headers",
"pw_preprocessor_headers",
"pw_result_headers",
"pw_span_headers",
"pw_spi_headers",
"pw_sync_headers",
],
static_libs: [
"pw_bytes",
"pw_status",
],
export_static_lib_headers: [
"pw_bytes",
"pw_status",
],
}