gn: Trim target prefixes from src/dawn targets

Removes stuttering.

Bug: dawn:1275
Change-Id: Ie32929e0b0ca579d7eef13a43fd2d1c648140276
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79101
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-02-04 17:15:16 +00:00 committed by Dawn LUCI CQ
parent 3bf9f6396c
commit 35940f9b83
11 changed files with 76 additions and 56 deletions

View File

@ -33,8 +33,8 @@ static_library("dawn_sample_utils") {
# Export all of these as public deps so that `gn check` allows includes
public_deps = [
"${dawn_root}/src/dawn:dawn_proc",
"${dawn_root}/src/dawn:dawncpp",
"${dawn_root}/src/dawn:cpp",
"${dawn_root}/src/dawn:proc",
"${dawn_root}/src/dawn/common",
"${dawn_root}/src/dawn/native",
"${dawn_root}/src/dawn/utils",

View File

@ -763,8 +763,8 @@ class MultiGeneratorFromDawnJSON(Generator):
def add_commandline_arguments(self, parser):
allowed_targets = [
'dawn_headers', 'dawncpp_headers', 'dawncpp', 'dawn_proc',
'mock_api', 'wire', "native_utils"
'dawn_headers', 'cpp_headers', 'cpp', 'proc', 'mock_api', 'wire',
'native_utils'
]
parser.add_argument('--dawn-json',
@ -802,7 +802,7 @@ class MultiGeneratorFromDawnJSON(Generator):
api = metadata.api.lower()
prefix = metadata.proc_table_prefix.lower()
if 'dawn_headers' in targets:
if 'headers' in targets:
renders.append(
FileRender('api.h', 'src/include/dawn/' + api + '.h',
[RENDER_PARAMS_BASE, params_dawn]))
@ -811,7 +811,7 @@ class MultiGeneratorFromDawnJSON(Generator):
'src/include/dawn/' + prefix + '_proc_table.h',
[RENDER_PARAMS_BASE, params_dawn]))
if 'dawncpp_headers' in targets:
if 'cpp_headers' in targets:
renders.append(
FileRender('api_cpp.h', 'src/include/dawn/' + api + '_cpp.h',
[RENDER_PARAMS_BASE, params_dawn]))
@ -821,7 +821,7 @@ class MultiGeneratorFromDawnJSON(Generator):
'src/include/dawn/' + api + '_cpp_print.h',
[RENDER_PARAMS_BASE, params_dawn]))
if 'dawn_proc' in targets:
if 'proc' in targets:
renders.append(
FileRender('dawn_proc.c', 'src/dawn/' + prefix + '_proc.c',
[RENDER_PARAMS_BASE, params_dawn]))
@ -836,7 +836,7 @@ class MultiGeneratorFromDawnJSON(Generator):
'src/dawn/native/webgpu_dawn_native_proc.cpp',
[RENDER_PARAMS_BASE, params_dawn]))
if 'dawncpp' in targets:
if 'cpp' in targets:
renders.append(
FileRender('api_cpp.cpp', 'src/dawn/' + api + '_cpp.cpp',
[RENDER_PARAMS_BASE, params_dawn]))

View File

@ -21,19 +21,19 @@ import("${dawn_root}/scripts/dawn_component.gni")
# Dawn headers
###############################################################################
dawn_json_generator("dawn_headers_gen") {
target = "dawn_headers"
dawn_json_generator("headers_gen") {
target = "headers"
outputs = [
"src/include/dawn/dawn_proc_table.h",
"src/include/dawn/webgpu.h",
]
}
source_set("dawn_headers") {
source_set("headers") {
all_dependent_configs = [ "${dawn_root}/src/dawn/common:public_include_dirs" ]
public_deps = [ ":dawn_headers_gen" ]
public_deps = [ ":headers_gen" ]
sources = get_target_outputs(":dawn_headers_gen")
sources = get_target_outputs(":headers_gen")
sources += [ "${dawn_root}/src/include/dawn/dawn_wsi.h" ]
}
@ -41,21 +41,21 @@ source_set("dawn_headers") {
# Dawn C++ headers
###############################################################################
dawn_json_generator("dawncpp_headers_gen") {
target = "dawncpp_headers"
dawn_json_generator("cpp_headers_gen") {
target = "cpp_headers"
outputs = [
"src/include/dawn/webgpu_cpp.h",
"src/include/dawn/webgpu_cpp_print.h",
]
}
source_set("dawncpp_headers") {
source_set("cpp_headers") {
public_deps = [
":dawn_headers",
":dawncpp_headers_gen",
":cpp_headers_gen",
":headers",
]
sources = get_target_outputs(":dawncpp_headers_gen")
sources = get_target_outputs(":cpp_headers_gen")
sources += [ "${dawn_root}/src/include/dawn/EnumClassBitmasks.h" ]
}
@ -63,37 +63,37 @@ source_set("dawncpp_headers") {
# Dawn C++ wrapper
###############################################################################
dawn_json_generator("dawncpp_gen") {
target = "dawncpp"
dawn_json_generator("cpp_gen") {
target = "cpp"
outputs = [ "src/dawn/webgpu_cpp.cpp" ]
}
source_set("dawncpp") {
source_set("cpp") {
deps = [
":dawncpp_gen",
":dawncpp_headers",
":cpp_gen",
":cpp_headers",
]
sources = get_target_outputs(":dawncpp_gen")
sources = get_target_outputs(":cpp_gen")
}
###############################################################################
# dawn_proc
# Dawn proc
###############################################################################
dawn_json_generator("dawn_proc_gen") {
target = "dawn_proc"
dawn_json_generator("proc_gen") {
target = "proc"
outputs = [
"src/dawn/dawn_proc.c",
"src/dawn/dawn_thread_dispatch_proc.cpp",
]
}
dawn_component("dawn_proc") {
dawn_component("proc") {
DEFINE_PREFIX = "WGPU"
public_deps = [ ":dawn_headers" ]
deps = [ ":dawn_proc_gen" ]
sources = get_target_outputs(":dawn_proc_gen")
public_deps = [ ":headers" ]
deps = [ ":proc_gen" ]
sources = get_target_outputs(":proc_gen")
sources += [
"${dawn_root}/src/include/dawn/dawn_proc.h",
"${dawn_root}/src/include/dawn/dawn_thread_dispatch_proc.h",
@ -119,3 +119,23 @@ dawn_json_generator("emscripten_bits_gen") {
"emscripten-bits/library_webgpu_enum_tables.js",
]
}
################################################################################
# Build target aliases
# TODO(crbug.com/dawn/1275) - remove these
################################################################################
group("dawncpp") {
public_deps = [ ":cpp" ]
}
group("dawncpp_headers") {
public_deps = [ ":cpp_headers" ]
}
group("dawn_proc") {
public_deps = [ ":proc" ]
}
group("dawn_headers") {
public_deps = [ ":headers" ]
}
group("dawn_cpp") {
public_deps = [ ":cpp" ]
}

View File

@ -17,7 +17,7 @@
###############################################################################
DawnJSONGenerator(
TARGET "dawn_headers"
TARGET "headers"
PRINT_NAME "Dawn headers"
RESULT_VARIABLE "DAWN_HEADERS_GEN_SOURCES"
)
@ -42,7 +42,7 @@ target_link_libraries(dawn_headers INTERFACE dawn_public_config)
###############################################################################
DawnJSONGenerator(
TARGET "dawncpp_headers"
TARGET "cpp_headers"
PRINT_NAME "Dawn C++ headers"
RESULT_VARIABLE "DAWNCPP_HEADERS_GEN_SOURCES"
)
@ -61,7 +61,7 @@ target_link_libraries(dawncpp_headers INTERFACE dawn_headers)
###############################################################################
DawnJSONGenerator(
TARGET "dawncpp"
TARGET "cpp"
PRINT_NAME "Dawn C++ wrapper"
RESULT_VARIABLE "DAWNCPP_GEN_SOURCES"
)
@ -75,7 +75,7 @@ target_link_libraries(dawncpp PUBLIC dawncpp_headers)
###############################################################################
DawnJSONGenerator(
TARGET "dawn_proc"
TARGET "proc"
PRINT_NAME "Dawn C++ wrapper"
RESULT_VARIABLE "DAWNPROC_GEN_SOURCES"
)

View File

@ -237,8 +237,8 @@ if (is_win || is_linux || is_chromeos || is_mac || is_fuchsia || is_android) {
public_configs = [ ":internal_config" ]
deps = [
"${dawn_root}/src/dawn:dawn_headers",
"${dawn_root}/src/dawn:dawncpp_headers",
"${dawn_root}/src/dawn:cpp_headers",
"${dawn_root}/src/dawn:headers",
]
if (is_win) {

View File

@ -137,7 +137,7 @@ if (dawn_enable_opengl) {
# Public dawn native headers so they can be publicly visible for
# dependencies of dawn native
source_set("headers") {
public_deps = [ "${dawn_root}/src/dawn:dawncpp_headers" ]
public_deps = [ "${dawn_root}/src/dawn:cpp_headers" ]
all_dependent_configs = [ "${dawn_root}/src/dawn/common:public_include_dirs" ]
sources = [
"${dawn_root}/src/include/dawn/native/DawnNative.h",

View File

@ -36,6 +36,6 @@ dawn_component("platform") {
public_deps = [
# DawnPlatform.h has #include <dawn/webgpu.h>
"${dawn_root}/src/dawn:dawn_headers",
"${dawn_root}/src/dawn:headers",
]
}

View File

@ -87,7 +87,7 @@ static_library("utils") {
"WireHelper.h",
]
deps = [
"${dawn_root}/src/dawn:dawn_proc",
"${dawn_root}/src/dawn:proc",
"${dawn_root}/src/dawn/common",
"${dawn_root}/src/dawn/native:headers",
"${dawn_root}/src/dawn/wire",
@ -134,7 +134,7 @@ static_library("utils") {
}
}
public_deps = [ "${dawn_root}/src/dawn:dawncpp_headers" ]
public_deps = [ "${dawn_root}/src/dawn:cpp_headers" ]
}
###############################################################################
@ -151,7 +151,7 @@ if (dawn_standalone) {
"BackendBinding.h",
]
public_deps = [ "${dawn_root}/src/dawn:dawn_headers" ]
public_deps = [ "${dawn_root}/src/dawn:headers" ]
deps = [
":glfw",

View File

@ -20,7 +20,7 @@ import("${dawn_root}/scripts/dawn_component.gni")
# Public dawn wire headers so they can be publically visible for dependencies of
# dawn/wire
source_set("headers") {
public_deps = [ "${dawn_root}/src/dawn:dawn_headers" ]
public_deps = [ "${dawn_root}/src/dawn:headers" ]
all_dependent_configs = [ "${dawn_root}/src/dawn/common:public_include_dirs" ]
sources = [
"${dawn_root}/src/include/dawn/wire/Wire.h",

View File

@ -75,8 +75,8 @@ static_library("dawn_wire_server_fuzzer_common") {
"DawnWireServerFuzzer.h",
]
public_deps = [
"${dawn_root}/src/dawn:dawn_proc",
"${dawn_root}/src/dawn:dawncpp",
"${dawn_root}/src/dawn:cpp",
"${dawn_root}/src/dawn:proc",
"${dawn_root}/src/dawn/common",
"${dawn_root}/src/dawn/native:static",
"${dawn_root}/src/dawn/utils",

View File

@ -166,8 +166,8 @@ test("dawn_unittests") {
":dawn_native_mocks_sources",
":gmock_and_gtest",
":mock_webgpu_gen",
"${dawn_root}/src/dawn:dawn_proc",
"${dawn_root}/src/dawn:dawncpp",
"${dawn_root}/src/dawn:cpp",
"${dawn_root}/src/dawn:proc",
"${dawn_root}/src/dawn/common",
"${dawn_root}/src/dawn/native:sources",
"${dawn_root}/src/dawn/native:static",
@ -323,8 +323,8 @@ source_set("dawn_end2end_tests_sources") {
deps = [
":gmock_and_gtest",
"${dawn_root}/src/dawn:dawn_proc",
"${dawn_root}/src/dawn:dawncpp",
"${dawn_root}/src/dawn:cpp",
"${dawn_root}/src/dawn:proc",
"${dawn_root}/src/dawn/common",
# Statically linked because the end2end white_box tests use Dawn internals.
@ -471,8 +471,8 @@ source_set("dawn_white_box_tests_sources") {
deps = [
":gmock_and_gtest",
"${dawn_root}/src/dawn:dawn_proc",
"${dawn_root}/src/dawn:dawncpp",
"${dawn_root}/src/dawn:cpp",
"${dawn_root}/src/dawn:proc",
"${dawn_root}/src/dawn/common",
"${dawn_root}/src/dawn/native:sources",
@ -548,8 +548,8 @@ test("dawn_end2end_tests") {
":dawn_end2end_tests_sources",
":dawn_white_box_tests_sources",
":gmock_and_gtest",
"${dawn_root}/src/dawn:dawn_proc",
"${dawn_root}/src/dawn:dawncpp",
"${dawn_root}/src/dawn:cpp",
"${dawn_root}/src/dawn:proc",
"${dawn_root}/src/dawn/common",
"${dawn_root}/src/dawn/native:static",
"${dawn_root}/src/dawn/utils",
@ -589,8 +589,8 @@ test("dawn_perf_tests") {
deps = [
":gmock_and_gtest",
"${dawn_root}/src/dawn:dawn_proc",
"${dawn_root}/src/dawn:dawncpp",
"${dawn_root}/src/dawn:cpp",
"${dawn_root}/src/dawn:proc",
"${dawn_root}/src/dawn/common",
"${dawn_root}/src/dawn/native",
"${dawn_root}/src/dawn/utils",