Corentin Wallez | b31015b | 2020-04-10 08:20:10 +0000 | [diff] [blame] | 1 | # Copyright 2020 The Dawn Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | import("../scripts/dawn_overrides_with_defaults.gni") |
| 16 | |
| 17 | group("dawn_samples") { |
| 18 | deps = [ |
| 19 | ":Animometer", |
| 20 | ":CHelloTriangle", |
| 21 | ":ComputeBoids", |
| 22 | ":CppHelloTriangle", |
| 23 | ":CubeReflection", |
| 24 | ":ManualSwapChainTest", |
| 25 | ] |
| 26 | } |
| 27 | |
| 28 | # Static library to contain code and dependencies common to all samples |
| 29 | static_library("dawn_sample_utils") { |
| 30 | sources = [ |
| 31 | "SampleUtils.cpp", |
| 32 | "SampleUtils.h", |
| 33 | ] |
| 34 | |
| 35 | # Export all of these as public deps so that `gn check` allows includes |
| 36 | public_deps = [ |
| 37 | "${dawn_root}/src/common", |
Corentin Wallez | 797fa62 | 2020-04-14 17:36:44 +0000 | [diff] [blame] | 38 | "${dawn_root}/src/dawn:dawn_proc", |
Corentin Wallez | b31015b | 2020-04-10 08:20:10 +0000 | [diff] [blame] | 39 | "${dawn_root}/src/dawn:dawncpp", |
Corentin Wallez | b31015b | 2020-04-10 08:20:10 +0000 | [diff] [blame] | 40 | "${dawn_root}/src/dawn_native", |
| 41 | "${dawn_root}/src/dawn_wire", |
| 42 | "${dawn_root}/src/utils:dawn_bindings", |
| 43 | "${dawn_root}/src/utils:dawn_glfw", |
| 44 | "${dawn_root}/src/utils:dawn_utils", |
| 45 | ] |
| 46 | public_configs = [ "${dawn_root}/src/common:dawn_internal" ] |
| 47 | } |
| 48 | |
| 49 | # Template for samples to avoid listing dawn_sample_utils as a dep every time |
| 50 | template("dawn_sample") { |
| 51 | executable(target_name) { |
Kai Ninomiya | 2afea0c | 2020-07-10 20:33:08 +0000 | [diff] [blame] | 52 | deps = [ ":dawn_sample_utils" ] |
Corentin Wallez | b31015b | 2020-04-10 08:20:10 +0000 | [diff] [blame] | 53 | forward_variables_from(invoker, "*", [ "deps" ]) |
| 54 | |
| 55 | if (defined(invoker.deps)) { |
| 56 | deps += invoker.deps |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | dawn_sample("CppHelloTriangle") { |
Kai Ninomiya | 2afea0c | 2020-07-10 20:33:08 +0000 | [diff] [blame] | 62 | sources = [ "CppHelloTriangle.cpp" ] |
Corentin Wallez | b31015b | 2020-04-10 08:20:10 +0000 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | dawn_sample("CHelloTriangle") { |
Kai Ninomiya | 2afea0c | 2020-07-10 20:33:08 +0000 | [diff] [blame] | 66 | sources = [ "CHelloTriangle.cpp" ] |
Corentin Wallez | b31015b | 2020-04-10 08:20:10 +0000 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | dawn_sample("ComputeBoids") { |
Kai Ninomiya | 2afea0c | 2020-07-10 20:33:08 +0000 | [diff] [blame] | 70 | sources = [ "ComputeBoids.cpp" ] |
| 71 | deps = [ "${dawn_root}/third_party/gn/glm" ] |
Corentin Wallez | b31015b | 2020-04-10 08:20:10 +0000 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | dawn_sample("Animometer") { |
Kai Ninomiya | 2afea0c | 2020-07-10 20:33:08 +0000 | [diff] [blame] | 75 | sources = [ "Animometer.cpp" ] |
Corentin Wallez | b31015b | 2020-04-10 08:20:10 +0000 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | dawn_sample("CubeReflection") { |
Kai Ninomiya | 2afea0c | 2020-07-10 20:33:08 +0000 | [diff] [blame] | 79 | sources = [ "CubeReflection.cpp" ] |
| 80 | deps = [ "${dawn_root}/third_party/gn/glm" ] |
Corentin Wallez | b31015b | 2020-04-10 08:20:10 +0000 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | dawn_sample("ManualSwapChainTest") { |
Kai Ninomiya | 2afea0c | 2020-07-10 20:33:08 +0000 | [diff] [blame] | 84 | sources = [ "ManualSwapChainTest.cpp" ] |
Corentin Wallez | b31015b | 2020-04-10 08:20:10 +0000 | [diff] [blame] | 85 | } |