blob: d46ceeee89ab860389e42b0223c1be92284af954 [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.
# default group
group("hello_world") {
deps = [ ":hello_bin" ]
if (is_fuchsia) {
public_deps = [
":hello_world_package",
]
}
}
# tests group
group("tests") {
testonly = true
if (is_fuchsia) {
public_deps = [
":hello_world_test",
":hello_world_test_package",
]
}
}
# Executable using both a static and shared lib.
executable("hello_bin") {
output_name = "hello_world"
sources = [ "hello.cc" ]
deps = [
":hello_shared",
":hello_static",
]
}
shared_library("hello_shared") {
sources = [
"hello_shared.cc",
"hello_shared.h",
]
defines = [ "HELLO_SHARED_IMPLEMENTATION" ]
}
static_library("hello_static") {
sources = [
"hello_static.cc",
"hello_static.h",
]
}
if (is_fuchsia) {
import("//third_party/fuchsia-sdk/build/component.gni")
import("//third_party/fuchsia-sdk/build/package.gni")
import("//third_party/fuchsia-sdk/build/test.gni")
fuchsia_component("component") {
manifest_output_name = "hello_world"
manifest = "meta/hello_world.cml"
data_deps = [ ":hello_bin" ]
}
fuchsia_package("hello_world_package") {
package_name = "hello_world"
deps = [ ":component" ]
}
fuchsia_test("hello_world_test") {
manifest = "meta/hello_world_test.cml"
sources = [ "test/hello_test.cc" ]
deps = [
"//third_party/googletest:gtest",
"//third_party/googletest:gtest_main",
]
}
}