blob: cf292b807d19293e46d20da0923215b675e01a73 [file] [log] [blame]
# Copyright 2020 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.
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/facade.gni")
import("$dir_pw_build/target_types.gni")
import("$dir_pw_docgen/docs.gni")
import("$dir_pw_unit_test/test.gni")
declare_args() {
# Backend for the pw_sync module's spin lock.
pw_sync_SPIN_LOCK_BACKEND = ""
}
config("public_include_path") {
include_dirs = [ "public" ]
visibility = [ ":*" ]
}
pw_facade("spin_lock") {
backend = pw_sync_SPIN_LOCK_BACKEND
public_configs = [ ":public_include_path" ]
public = [ "public/pw_sync/spin_lock.h" ]
public_deps = [ "$dir_pw_preprocessor" ]
sources = [ "spin_lock.cc" ]
}
pw_test_group("tests") {
tests = [ ":spin_lock_facade_test" ]
}
pw_source_set("yield_core") {
public = [ "public/pw_sync/yield_core.h" ]
public_configs = [ ":public_include_path" ]
}
pw_test("spin_lock_facade_test") {
enable_if = pw_sync_SPIN_LOCK_BACKEND != ""
sources = [
"spin_lock_facade_test.cc",
"spin_lock_facade_test_c.c",
]
deps = [
":spin_lock",
"$dir_pw_preprocessor",
pw_sync_SPIN_LOCK_BACKEND,
]
}
pw_doc_group("docs") {
sources = [ "docs.rst" ]
}