blob: bfe98756d49fbd93d8ffc0bcfd7ecf3d885f85ff [file] [log] [blame]
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file
config("schema_path") {
if (is_host) {
defines = [ "STORAGE_VOLUME_IMAGE_SCHEMA_PATH=\"schema/\"" ]
} else {
defines = [ "STORAGE_VOLUME_IMAGE_SCHEMA_PATH=\"pkg/data/schema/\"" ]
}
}
copy("schema_json") {
sources = [
"address_descriptor.schema.json",
"volume_descriptor.schema.json",
"volume_image.schema.json",
]
outputs = [ "$root_out_dir/schema/{{source_file_part}}" ]
}
source_set("schema") {
sources = [ "schema.cc" ]
public = [ "schema.h" ]
configs += [ ":schema_path" ]
deps = [ "//src/storage/volume_image/utils:path" ]
if (is_host) {
deps += [ ":schema_json" ]
metadata = {
runtime_deps = get_target_outputs(":schema_json")
}
}
}
source_set("schema-test") {
testonly = true
sources = [ "schema_test.cc" ]
deps = [
":schema",
"//src/lib/json_parser",
"//third_party/googletest:gtest",
]
if (is_host) {
metadata = {
test_runtime_deps = get_target_outputs(":schema_json")
}
}
}
group("tests") {
testonly = true
deps = [ ":schema-test" ]
}