blob: 5e193c8eba333593fc9f251e4bf75dad9972b6f8 [file] [log] [blame]
# Copyright 2019 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.
template("magma_pdev_entry") {
source_set(target_name) {
forward_variables_from(invoker, "*")
if (!defined(invoker.test_entry)) {
test_entry = false
} else {
test_entry = true
}
if (!defined(invoker.deps)) {
deps = []
}
if (!defined(invoker.sources)) {
sources = []
}
if (!defined(invoker.include_dirs)) {
include_dirs = []
}
if (!defined(invoker.defines)) {
defines = []
}
sources +=
[ "//src/graphics/lib/magma/src/magma_util/platform/zircon/binding.cc" ]
# Add the target gen directory as an include path so that `#include "bind.h"` will find the
# correct generated bind header. This allows us to use the same binding.cc file with multiple
# different bind rules.
include_dirs += [ "${target_gen_dir}" ]
if (test_entry) {
testonly = true
defines += [ "TEST=1" ]
deps += [
"//src/graphics/lib/magma/src/magma_util/platform/zircon:entry_test",
"//src/graphics/lib/magma/src/magma_util/platform/zircon:pdev_driver_gtest",
"//src/lib/ddk",
]
} else {
deps += [
"//src/graphics/lib/magma/src/magma_util/platform/zircon:entry",
"//src/lib/ddk",
]
}
}
}