blob: 3140b71cc74efd219a5896d88fc450953621beef [file] [log] [blame]
# Copyright 2019 The Dawn Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../../scripts/dawn_overrides_with_defaults.gni")
import("//build_overrides/build.gni")
import("${dawn_root}/scripts/dawn_features.gni")
# Use Chromium's dcheck_always_on when available so that we respect it when
# running tests on the GPU builders
if (build_with_chromium) {
import("//build/config/dcheck_always_on.gni")
} else {
dcheck_always_on = false
}
###############################################################################
# Common dawn configs
###############################################################################
config("dawn_public") {
include_dirs = [
"${target_gen_dir}/../..",
"${dawn_root}/src/include"
]
}
config("dawn_internal") {
include_dirs = [ "${dawn_root}/src" ]
defines = []
if (dawn_always_assert || dcheck_always_on || is_debug) {
defines += [ "DAWN_ENABLE_ASSERTS" ]
}
if (dawn_enable_d3d12) {
defines += [ "DAWN_ENABLE_BACKEND_D3D12" ]
}
if (dawn_enable_metal) {
defines += [ "DAWN_ENABLE_BACKEND_METAL" ]
}
if (dawn_enable_null) {
defines += [ "DAWN_ENABLE_BACKEND_NULL" ]
}
if (dawn_enable_opengl) {
defines += [ "DAWN_ENABLE_BACKEND_OPENGL" ]
}
if (dawn_enable_vulkan) {
defines += [ "DAWN_ENABLE_BACKEND_VULKAN" ]
}
configs = [ ":dawn_public" ]
# Only internal Dawn targets can use this config, this means only targets in
# this BUILD.gn file.
visibility = [ ":*" ]
}
###############################################################################
# Common dawn library
###############################################################################
static_library("common") {
sources = [
"Assert.cpp",
"Assert.h",
"BitSetIterator.h",
"Compiler.h",
"DynamicLib.cpp",
"DynamicLib.h",
"HashUtils.h",
"Math.cpp",
"Math.h",
"Platform.h",
"Result.h",
"Serial.h",
"SerialMap.h",
"SerialQueue.h",
"SerialStorage.h",
"SwapChainUtils.h",
"vulkan_platform.h",
"windows_with_undefs.h",
]
configs += [ ":dawn_internal" ]
deps = [
"${dawn_root}/src/dawn:dawn_headers",
]
}