mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 10:51:35 +00:00
tint->dawn: Move examples -> samples/dawn
Bug: dawn:1275 Change-Id: I4824aaabc2c2b55a609a6e1370959394b93463b8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79103 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
9fb7a5146a
commit
a6750751c7
2
BUILD.gn
2
BUILD.gn
@ -22,7 +22,7 @@ group("all") {
|
|||||||
"src/tests:dawn_tests",
|
"src/tests:dawn_tests",
|
||||||
]
|
]
|
||||||
if (dawn_standalone) {
|
if (dawn_standalone) {
|
||||||
deps += [ "examples:dawn_samples" ]
|
deps += [ "samples/dawn:samples" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ set(ENABLE_OPENGLES OFF)
|
|||||||
set(ENABLE_DESKTOP_GL OFF)
|
set(ENABLE_DESKTOP_GL OFF)
|
||||||
set(ENABLE_VULKAN OFF)
|
set(ENABLE_VULKAN OFF)
|
||||||
set(USE_X11 OFF)
|
set(USE_X11 OFF)
|
||||||
set(BUILD_EXAMPLE OFF)
|
set(BUILD_SAMPLES OFF)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(ENABLE_D3D12 ON)
|
set(ENABLE_D3D12 ON)
|
||||||
if (NOT WINDOWS_STORE)
|
if (NOT WINDOWS_STORE)
|
||||||
@ -102,7 +102,7 @@ endif()
|
|||||||
|
|
||||||
# Current examples are depend on GLFW
|
# Current examples are depend on GLFW
|
||||||
if (DAWN_SUPPORTS_GLFW_FOR_WINDOWING)
|
if (DAWN_SUPPORTS_GLFW_FOR_WINDOWING)
|
||||||
set(BUILD_EXAMPLE ON)
|
set(BUILD_SAMPLES ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option_if_not_defined(DAWN_ENABLE_D3D12 "Enable compilation of the D3D12 backend" ${ENABLE_D3D12})
|
option_if_not_defined(DAWN_ENABLE_D3D12 "Enable compilation of the D3D12 backend" ${ENABLE_D3D12})
|
||||||
@ -114,7 +114,7 @@ option_if_not_defined(DAWN_ENABLE_VULKAN "Enable compilation of the Vulkan backe
|
|||||||
option_if_not_defined(DAWN_ALWAYS_ASSERT "Enable assertions on all build types" OFF)
|
option_if_not_defined(DAWN_ALWAYS_ASSERT "Enable assertions on all build types" OFF)
|
||||||
option_if_not_defined(DAWN_USE_X11 "Enable support for X11 surface" ${USE_X11})
|
option_if_not_defined(DAWN_USE_X11 "Enable support for X11 surface" ${USE_X11})
|
||||||
|
|
||||||
option_if_not_defined(DAWN_BUILD_EXAMPLES "Enables building Dawn's exmaples" ${BUILD_EXAMPLE})
|
option_if_not_defined(DAWN_BUILD_SAMPLES "Enables building Dawn's samples" ${BUILD_SAMPLES})
|
||||||
option_if_not_defined(DAWN_BUILD_NODE_BINDINGS "Enables building Dawn's NodeJS bindings" OFF)
|
option_if_not_defined(DAWN_BUILD_NODE_BINDINGS "Enables building Dawn's NodeJS bindings" OFF)
|
||||||
|
|
||||||
option_if_not_defined(DAWN_ENABLE_PIC "Build with Position-Independent-Code enabled" OFF)
|
option_if_not_defined(DAWN_ENABLE_PIC "Build with Position-Independent-Code enabled" OFF)
|
||||||
@ -220,10 +220,10 @@ add_subdirectory(src/dawn/wire)
|
|||||||
# TODO(dawn:269): Remove once the implementation-based swapchains are removed.
|
# TODO(dawn:269): Remove once the implementation-based swapchains are removed.
|
||||||
add_subdirectory(src/dawn/utils)
|
add_subdirectory(src/dawn/utils)
|
||||||
|
|
||||||
if (DAWN_BUILD_EXAMPLES)
|
if (DAWN_BUILD_SAMPLES)
|
||||||
#TODO(dawn:269): Add this once implementation-based swapchains are removed.
|
#TODO(dawn:269): Add this once implementation-based swapchains are removed.
|
||||||
#add_subdirectory(src/dawn/utils)
|
#add_subdirectory(src/dawn/utils)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(samples/dawn)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DAWN_BUILD_NODE_BINDINGS)
|
if (DAWN_BUILD_NODE_BINDINGS)
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import("../scripts/dawn_overrides_with_defaults.gni")
|
import("../../scripts/dawn_overrides_with_defaults.gni")
|
||||||
|
|
||||||
group("dawn_samples") {
|
group("samples") {
|
||||||
deps = [
|
deps = [
|
||||||
":Animometer",
|
":Animometer",
|
||||||
":CHelloTriangle",
|
":CHelloTriangle",
|
||||||
@ -25,7 +25,7 @@ group("dawn_samples") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Static library to contain code and dependencies common to all samples
|
# Static library to contain code and dependencies common to all samples
|
||||||
static_library("dawn_sample_utils") {
|
static_library("utils") {
|
||||||
sources = [
|
sources = [
|
||||||
"SampleUtils.cpp",
|
"SampleUtils.cpp",
|
||||||
"SampleUtils.h",
|
"SampleUtils.h",
|
||||||
@ -34,7 +34,6 @@ static_library("dawn_sample_utils") {
|
|||||||
# Export all of these as public deps so that `gn check` allows includes
|
# Export all of these as public deps so that `gn check` allows includes
|
||||||
public_deps = [
|
public_deps = [
|
||||||
"${dawn_root}/src/dawn:cpp",
|
"${dawn_root}/src/dawn:cpp",
|
||||||
"${dawn_root}/src/dawn:proc",
|
|
||||||
"${dawn_root}/src/dawn/common",
|
"${dawn_root}/src/dawn/common",
|
||||||
"${dawn_root}/src/dawn/native",
|
"${dawn_root}/src/dawn/native",
|
||||||
"${dawn_root}/src/dawn/utils",
|
"${dawn_root}/src/dawn/utils",
|
||||||
@ -45,10 +44,10 @@ static_library("dawn_sample_utils") {
|
|||||||
public_configs = [ "${dawn_root}/src/dawn/common:internal_config" ]
|
public_configs = [ "${dawn_root}/src/dawn/common:internal_config" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Template for samples to avoid listing dawn_sample_utils as a dep every time
|
# Template for samples to avoid listing utils as a dep every time
|
||||||
template("dawn_sample") {
|
template("sample") {
|
||||||
executable(target_name) {
|
executable(target_name) {
|
||||||
deps = [ ":dawn_sample_utils" ]
|
deps = [ ":utils" ]
|
||||||
forward_variables_from(invoker, "*", [ "deps" ])
|
forward_variables_from(invoker, "*", [ "deps" ])
|
||||||
|
|
||||||
if (defined(invoker.deps)) {
|
if (defined(invoker.deps)) {
|
||||||
@ -57,22 +56,22 @@ template("dawn_sample") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dawn_sample("CppHelloTriangle") {
|
sample("CppHelloTriangle") {
|
||||||
sources = [ "CppHelloTriangle.cpp" ]
|
sources = [ "CppHelloTriangle.cpp" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
dawn_sample("CHelloTriangle") {
|
sample("CHelloTriangle") {
|
||||||
sources = [ "CHelloTriangle.cpp" ]
|
sources = [ "CHelloTriangle.cpp" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
dawn_sample("ComputeBoids") {
|
sample("ComputeBoids") {
|
||||||
sources = [ "ComputeBoids.cpp" ]
|
sources = [ "ComputeBoids.cpp" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
dawn_sample("Animometer") {
|
sample("Animometer") {
|
||||||
sources = [ "Animometer.cpp" ]
|
sources = [ "Animometer.cpp" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
dawn_sample("ManualSwapChainTest") {
|
sample("ManualSwapChainTest") {
|
||||||
sources = [ "ManualSwapChainTest.cpp" ]
|
sources = [ "ManualSwapChainTest.cpp" ]
|
||||||
}
|
}
|
@ -14,21 +14,20 @@
|
|||||||
|
|
||||||
#include "SampleUtils.h"
|
#include "SampleUtils.h"
|
||||||
|
|
||||||
|
#include "GLFW/glfw3.h"
|
||||||
#include "dawn/common/Assert.h"
|
#include "dawn/common/Assert.h"
|
||||||
#include "dawn/common/Log.h"
|
#include "dawn/common/Log.h"
|
||||||
#include "dawn/common/Platform.h"
|
#include "dawn/common/Platform.h"
|
||||||
#include "dawn/common/SystemUtils.h"
|
#include "dawn/common/SystemUtils.h"
|
||||||
|
#include "dawn/dawn_proc.h"
|
||||||
|
#include "dawn/dawn_wsi.h"
|
||||||
|
#include "dawn/native/DawnNative.h"
|
||||||
#include "dawn/utils/BackendBinding.h"
|
#include "dawn/utils/BackendBinding.h"
|
||||||
#include "dawn/utils/GLFWUtils.h"
|
#include "dawn/utils/GLFWUtils.h"
|
||||||
#include "dawn/utils/TerribleCommandBuffer.h"
|
#include "dawn/utils/TerribleCommandBuffer.h"
|
||||||
#include "dawn/wire/WireClient.h"
|
#include "dawn/wire/WireClient.h"
|
||||||
#include "dawn/wire/WireServer.h"
|
#include "dawn/wire/WireServer.h"
|
||||||
|
|
||||||
#include <dawn/dawn_proc.h>
|
|
||||||
#include <dawn/dawn_wsi.h>
|
|
||||||
#include <dawn/native/DawnNative.h>
|
|
||||||
#include "GLFW/glfw3.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
@ -85,7 +85,7 @@ config("internal_config") {
|
|||||||
# Only internal Dawn targets can use this config, this means only targets in
|
# Only internal Dawn targets can use this config, this means only targets in
|
||||||
# this BUILD.gn file and related subdirs.
|
# this BUILD.gn file and related subdirs.
|
||||||
visibility = [
|
visibility = [
|
||||||
"${dawn_root}/examples/*",
|
"${dawn_root}/samples/dawn/*",
|
||||||
"${dawn_root}/src/*",
|
"${dawn_root}/src/*",
|
||||||
"${dawn_root}/src/dawn/*",
|
"${dawn_root}/src/dawn/*",
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user