blob: a915ec9c263dbd249fa0c2f8c4656962415bc56b [file] [log] [blame]
# Copyright 2019 The Dawn & Tint Authors
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("../../../scripts/dawn_overrides_with_defaults.gni")
import("${dawn_root}/generator/dawn_generator.gni")
import("${dawn_root}/scripts/dawn_component.gni")
# Public dawn wire headers so they can be publicly visible for dependencies of
# dawn/wire
source_set("headers") {
public_deps = [ "${dawn_root}/include/dawn:headers" ]
all_dependent_configs = [ "${dawn_root}/include/dawn:public" ]
sources = [
"${dawn_root}/include/dawn/wire/Wire.h",
"${dawn_root}/include/dawn/wire/WireClient.h",
"${dawn_root}/include/dawn/wire/WireServer.h",
"${dawn_root}/include/dawn/wire/dawn_wire_export.h",
]
}
dawn_json_generator("gen") {
target = "wire"
outputs = [
"src/dawn/wire/ObjectType_autogen.h",
"src/dawn/wire/WireCmd_autogen.h",
"src/dawn/wire/WireCmd_autogen.cpp",
"src/dawn/wire/client/ApiObjects_autogen.h",
"src/dawn/wire/client/ApiProcs_autogen.cpp",
"src/dawn/wire/client/ClientBase_autogen.h",
"src/dawn/wire/client/ClientHandlers_autogen.cpp",
"src/dawn/wire/client/ClientPrototypes_autogen.inc",
"src/dawn/wire/server/ServerBase_autogen.h",
"src/dawn/wire/server/ServerDoers_autogen.cpp",
"src/dawn/wire/server/ServerHandlers_autogen.cpp",
"src/dawn/wire/server/ServerPrototypes_autogen.inc",
"src/dawn/wire/server/WGPUTraits_autogen.h",
]
}
group("abseil") {
# When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while
# it's beneficial to be more specific with standalone Dawn, especially when it comes to
# including it as a dependency in other projects (such as Skia).
if (build_with_chromium) {
public_deps = [ "$dawn_abseil_dir:absl" ]
} else {
public_deps = [
"${dawn_abseil_dir}/absl/container:flat_hash_map",
"${dawn_abseil_dir}/absl/container:flat_hash_set",
]
}
}
dawn_component("wire") {
DEFINE_PREFIX = "DAWN_WIRE"
deps = [
":gen",
"${dawn_root}/src/dawn/common",
"${dawn_root}/src/tint/lang/wgsl/features",
]
configs = [ "${dawn_root}/src/dawn/common:internal_config" ]
sources = get_target_outputs(":gen")
sources += [
"BufferConsumer.h",
"BufferConsumer_impl.h",
"ChunkedCommandHandler.cpp",
"ChunkedCommandHandler.h",
"ChunkedCommandSerializer.cpp",
"ChunkedCommandSerializer.h",
"ObjectHandle.cpp",
"ObjectHandle.h",
"SupportedFeatures.cpp",
"SupportedFeatures.h",
"Wire.cpp",
"WireClient.cpp",
"WireDeserializeAllocator.cpp",
"WireDeserializeAllocator.h",
"WireResult.h",
"WireServer.cpp",
"client/Adapter.cpp",
"client/Adapter.h",
"client/ApiObjects.h",
"client/Buffer.cpp",
"client/Buffer.h",
"client/Client.cpp",
"client/Client.h",
"client/ClientDoers.cpp",
"client/ClientInlineMemoryTransferService.cpp",
"client/Device.cpp",
"client/Device.h",
"client/EventManager.cpp",
"client/EventManager.h",
"client/Instance.cpp",
"client/Instance.h",
"client/LimitsAndFeatures.cpp",
"client/LimitsAndFeatures.h",
"client/ObjectBase.cpp",
"client/ObjectBase.h",
"client/ObjectStore.cpp",
"client/ObjectStore.h",
"client/QuerySet.cpp",
"client/QuerySet.h",
"client/Queue.cpp",
"client/Queue.h",
"client/ShaderModule.cpp",
"client/ShaderModule.h",
"client/Surface.cpp",
"client/Surface.h",
"client/SwapChain.cpp",
"client/SwapChain.h",
"client/Texture.cpp",
"client/Texture.h",
"server/ObjectStorage.h",
"server/Server.cpp",
"server/Server.h",
"server/ServerAdapter.cpp",
"server/ServerBuffer.cpp",
"server/ServerDevice.cpp",
"server/ServerInlineMemoryTransferService.cpp",
"server/ServerInstance.cpp",
"server/ServerQueue.cpp",
"server/ServerShaderModule.cpp",
]
# Make headers publicly visible
public_deps = [
":abseil",
":headers",
"${dawn_root}/src/dawn/partition_alloc:raw_ptr",
]
}