mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 05:57:51 +00:00
Remove support for CMake builds
This also removes support for Travis and AppVeyor, as well as git submodules for dependencies. It also adjusts .gitignore to include dependencies (submodules are implicitly ignored but are removed in this commit). Finally, removes some CMake-specific code from the code generator. BUG= Change-Id: I4ebc04e530a574b412ef0ca81e4672db01f0ed92 Reviewed-on: https://dawn-review.googlesource.com/c/2040 Reviewed-by: Stephen White <senorblanco@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
84cde51741
commit
146edf5bec
@@ -1,37 +0,0 @@
|
||||
# Copyright 2017 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.
|
||||
|
||||
set(COMMON_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
list(APPEND COMMON_SOURCES
|
||||
${COMMON_DIR}/Assert.cpp
|
||||
${COMMON_DIR}/Assert.h
|
||||
${COMMON_DIR}/BitSetIterator.h
|
||||
${COMMON_DIR}/Compiler.h
|
||||
${COMMON_DIR}/DynamicLib.cpp
|
||||
${COMMON_DIR}/DynamicLib.h
|
||||
${COMMON_DIR}/HashUtils.h
|
||||
${COMMON_DIR}/Math.cpp
|
||||
${COMMON_DIR}/Math.h
|
||||
${COMMON_DIR}/Platform.h
|
||||
${COMMON_DIR}/Result.h
|
||||
${COMMON_DIR}/Serial.h
|
||||
${COMMON_DIR}/SerialQueue.h
|
||||
${COMMON_DIR}/SwapChainUtils.h
|
||||
${COMMON_DIR}/vulkan_platform.h
|
||||
${COMMON_DIR}/windows_with_undefs.h
|
||||
)
|
||||
|
||||
add_library(dawn_common STATIC ${COMMON_SOURCES})
|
||||
DawnInternalTarget("" dawn_common)
|
||||
@@ -1,409 +0,0 @@
|
||||
# Copyright 2017 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.
|
||||
|
||||
set(DAWN_NATIVE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(D3D12_DIR ${CMAKE_CURRENT_SOURCE_DIR}/d3d12)
|
||||
set(METAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/metal)
|
||||
set(NULL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/null)
|
||||
set(OPENGL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/opengl)
|
||||
set(VULKAN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vulkan)
|
||||
set(DAWN_NATIVE_INCLUDE_DIR ${INCLUDE_DIR}/dawn_native)
|
||||
|
||||
Generate(
|
||||
LIB_NAME dawn_native_utils_autogen
|
||||
LIB_TYPE STATIC
|
||||
FOLDER "dawn_native"
|
||||
PRINT_NAME "Autogenerated dawn_native utilities"
|
||||
COMMAND_LINE_ARGS
|
||||
${GENERATOR_COMMON_ARGS}
|
||||
-T dawn_native_utils
|
||||
)
|
||||
|
||||
set(DAWN_NATIVE_SOURCES)
|
||||
set(DAWN_NATIVE_DEPS dawn_common spirv_cross dawn_native_utils_autogen SPIRV-Tools)
|
||||
set(DAWN_NATIVE_INCLUDE_DIRS ${SPIRV_CROSS_INCLUDE_DIR} ${SPIRV_TOOLS_INCLUDE_DIR})
|
||||
|
||||
################################################################################
|
||||
# OpenGL Backend
|
||||
################################################################################
|
||||
|
||||
if (DAWN_ENABLE_OPENGL)
|
||||
list(APPEND DAWN_NATIVE_DEPS glad)
|
||||
list(APPEND DAWN_NATIVE_INCLUDE_DIRS ${GLAD_INCLUDE_DIR})
|
||||
list(APPEND DAWN_NATIVE_SOURCES
|
||||
${OPENGL_DIR}/BlendStateGL.cpp
|
||||
${OPENGL_DIR}/BlendStateGL.h
|
||||
${OPENGL_DIR}/BufferGL.cpp
|
||||
${OPENGL_DIR}/BufferGL.h
|
||||
${OPENGL_DIR}/CommandBufferGL.cpp
|
||||
${OPENGL_DIR}/CommandBufferGL.h
|
||||
${OPENGL_DIR}/ComputePipelineGL.cpp
|
||||
${OPENGL_DIR}/ComputePipelineGL.h
|
||||
${OPENGL_DIR}/DepthStencilStateGL.cpp
|
||||
${OPENGL_DIR}/DepthStencilStateGL.h
|
||||
${OPENGL_DIR}/DeviceGL.cpp
|
||||
${OPENGL_DIR}/DeviceGL.h
|
||||
${OPENGL_DIR}/Forward.h
|
||||
${OPENGL_DIR}/InputStateGL.cpp
|
||||
${OPENGL_DIR}/InputStateGL.h
|
||||
${OPENGL_DIR}/PersistentPipelineStateGL.cpp
|
||||
${OPENGL_DIR}/PersistentPipelineStateGL.h
|
||||
${OPENGL_DIR}/PipelineGL.cpp
|
||||
${OPENGL_DIR}/PipelineGL.h
|
||||
${OPENGL_DIR}/PipelineLayoutGL.cpp
|
||||
${OPENGL_DIR}/PipelineLayoutGL.h
|
||||
${OPENGL_DIR}/QueueGL.cpp
|
||||
${OPENGL_DIR}/QueueGL.h
|
||||
${OPENGL_DIR}/RenderPipelineGL.cpp
|
||||
${OPENGL_DIR}/RenderPipelineGL.h
|
||||
${OPENGL_DIR}/SamplerGL.cpp
|
||||
${OPENGL_DIR}/SamplerGL.h
|
||||
${OPENGL_DIR}/ShaderModuleGL.cpp
|
||||
${OPENGL_DIR}/ShaderModuleGL.h
|
||||
${OPENGL_DIR}/SwapChainGL.cpp
|
||||
${OPENGL_DIR}/SwapChainGL.h
|
||||
${OPENGL_DIR}/TextureGL.cpp
|
||||
${OPENGL_DIR}/TextureGL.h
|
||||
${DAWN_NATIVE_INCLUDE_DIR}/OpenGLBackend.h
|
||||
)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Null Backend
|
||||
################################################################################
|
||||
|
||||
if (DAWN_ENABLE_NULL)
|
||||
list(APPEND DAWN_NATIVE_SOURCES
|
||||
${NULL_DIR}/NullBackend.cpp
|
||||
${NULL_DIR}/NullBackend.h
|
||||
${DAWN_NATIVE_INCLUDE_DIR}/NullBackend.h
|
||||
)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Metal Backend
|
||||
################################################################################
|
||||
|
||||
if (DAWN_ENABLE_METAL)
|
||||
list(APPEND DAWN_NATIVE_DEPS "-framework Metal" "-framework Cocoa")
|
||||
|
||||
list(APPEND DAWN_NATIVE_SOURCES
|
||||
${METAL_DIR}/BlendStateMTL.mm
|
||||
${METAL_DIR}/BlendStateMTL.h
|
||||
${METAL_DIR}/BufferMTL.mm
|
||||
${METAL_DIR}/BufferMTL.h
|
||||
${METAL_DIR}/CommandBufferMTL.mm
|
||||
${METAL_DIR}/CommandBufferMTL.h
|
||||
${METAL_DIR}/ComputePipelineMTL.mm
|
||||
${METAL_DIR}/ComputePipelineMTL.h
|
||||
${METAL_DIR}/DepthStencilStateMTL.mm
|
||||
${METAL_DIR}/DepthStencilStateMTL.h
|
||||
${METAL_DIR}/DeviceMTL.mm
|
||||
${METAL_DIR}/DeviceMTL.h
|
||||
${METAL_DIR}/Forward.h
|
||||
${METAL_DIR}/InputStateMTL.mm
|
||||
${METAL_DIR}/InputStateMTL.h
|
||||
${METAL_DIR}/PipelineLayoutMTL.mm
|
||||
${METAL_DIR}/PipelineLayoutMTL.h
|
||||
${METAL_DIR}/QueueMTL.mm
|
||||
${METAL_DIR}/QueueMTL.h
|
||||
${METAL_DIR}/RenderPipelineMTL.mm
|
||||
${METAL_DIR}/RenderPipelineMTL.h
|
||||
${METAL_DIR}/ResourceUploader.mm
|
||||
${METAL_DIR}/ResourceUploader.h
|
||||
${METAL_DIR}/SamplerMTL.mm
|
||||
${METAL_DIR}/SamplerMTL.h
|
||||
${METAL_DIR}/ShaderModuleMTL.mm
|
||||
${METAL_DIR}/ShaderModuleMTL.h
|
||||
${METAL_DIR}/SwapChainMTL.mm
|
||||
${METAL_DIR}/SwapChainMTL.h
|
||||
${METAL_DIR}/TextureMTL.mm
|
||||
${METAL_DIR}/TextureMTL.h
|
||||
${DAWN_NATIVE_INCLUDE_DIR}/MetalBackend.h
|
||||
)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# D3D12 Backend
|
||||
################################################################################
|
||||
|
||||
if (DAWN_ENABLE_D3D12)
|
||||
# WIN10_SDK_PATH will be something like C:\Program Files (x86)\Windows Kits\10
|
||||
get_filename_component(WIN10_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]" ABSOLUTE CACHE)
|
||||
|
||||
# TEMP_WIN10_SDK_VERSION will be something like ${CMAKE_CURRENT_SOURCE_DIR}\10.0.14393 or ${CMAKE_CURRENT_SOURCE_DIR}\10.0.14393.0
|
||||
get_filename_component(TEMP_WIN10_SDK_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;ProductVersion]" ABSOLUTE CACHE)
|
||||
|
||||
# strip off ${CMAKE_CURRENT_SOURCE_DIR} to get just the version number
|
||||
get_filename_component(WIN10_SDK_VERSION ${TEMP_WIN10_SDK_VERSION} NAME)
|
||||
# WIN10_SDK_VERSION will be something like 10.0.14393 or 10.0.14393.0; we need the one that matches the directory name.
|
||||
if (IS_DIRECTORY "${WIN10_SDK_PATH}/Include/${WIN10_SDK_VERSION}.0")
|
||||
set(WIN10_SDK_VERSION "${WIN10_SDK_VERSION}.0")
|
||||
endif()
|
||||
|
||||
# Find the d3d12 and dxgi include path, it will typically look something like this.
|
||||
# C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\um\d3d12.h
|
||||
# C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\shared\dxgi1_4.h
|
||||
find_path(D3D12_INCLUDE_DIR # Set variable D3D12_INCLUDE_DIR
|
||||
d3d12.h # Find a path with d3d12.h
|
||||
HINTS "${WIN10_SDK_PATH}/Include/${WIN10_SDK_VERSION}/um"
|
||||
DOC "path to WIN10 SDK header files"
|
||||
HINTS
|
||||
)
|
||||
|
||||
find_path(DXGI_INCLUDE_DIR # Set variable DXGI_INCLUDE_DIR
|
||||
dxgi1_4.h # Find a path with dxgi1_4.h
|
||||
HINTS "${WIN10_SDK_PATH}/Include/${WIN10_SDK_VERSION}/shared"
|
||||
DOC "path to WIN10 SDK header files"
|
||||
HINTS
|
||||
)
|
||||
|
||||
if (CMAKE_GENERATOR MATCHES "Visual Studio.*ARM" )
|
||||
set(WIN10_SDK_LIB_PATH ${WIN10_SDK_PATH}/Lib/${WIN10_SDK_VERSION}/um/arm)
|
||||
elseif (CMAKE_GENERATOR MATCHES "Visual Studio.*ARM64" )
|
||||
set(WIN10_SDK_LIB_PATH ${WIN10_SDK_PATH}/Lib/${WIN10_SDK_VERSION}/um/arm64)
|
||||
elseif (CMAKE_GENERATOR MATCHES "Visual Studio.*Win64" )
|
||||
set(WIN10_SDK_LIB_PATH ${WIN10_SDK_PATH}/Lib/${WIN10_SDK_VERSION}/um/x64)
|
||||
else()
|
||||
set(WIN10_SDK_LIB_PATH ${WIN10_SDK_PATH}/Lib/${WIN10_SDK_VERSION}/um/x86)
|
||||
endif()
|
||||
|
||||
find_library(D3D12_LIBRARY NAMES d3d12.lib HINTS ${WIN10_SDK_LIB_PATH})
|
||||
find_library(DXGI_LIBRARY NAMES dxgi.lib HINTS ${WIN10_SDK_LIB_PATH})
|
||||
find_library(D3DCOMPILER_LIBRARY NAMES d3dcompiler.lib HINTS ${WIN10_SDK_LIB_PATH})
|
||||
|
||||
list(APPEND D3D12_LIBRARIES
|
||||
${D3D12_LIBRARY}
|
||||
${DXGI_LIBRARY}
|
||||
${D3DCOMPILER_LIBRARY}
|
||||
)
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
find_library(DXGUID_LIBRARY NAMES dxguid.lib HINTS ${WIN10_SDK_LIB_PATH})
|
||||
list(APPEND D3D12_LIBRARIES ${DXGUID_LIBRARY})
|
||||
endif()
|
||||
|
||||
list(APPEND DAWN_NATIVE_DEPS ${D3D12_LIBRARIES})
|
||||
list(APPEND DAWN_NATIVE_INCLUDE_DIRS ${D3D12_INCLUDE_DIR} ${DXGI_INCLUDE_DIR})
|
||||
list(APPEND DAWN_NATIVE_SOURCES
|
||||
${D3D12_DIR}/d3d12_platform.h
|
||||
${D3D12_DIR}/BindGroupD3D12.cpp
|
||||
${D3D12_DIR}/BindGroupD3D12.h
|
||||
${D3D12_DIR}/BindGroupLayoutD3D12.cpp
|
||||
${D3D12_DIR}/BindGroupLayoutD3D12.h
|
||||
${D3D12_DIR}/BlendStateD3D12.cpp
|
||||
${D3D12_DIR}/BlendStateD3D12.h
|
||||
${D3D12_DIR}/BufferD3D12.cpp
|
||||
${D3D12_DIR}/BufferD3D12.h
|
||||
${D3D12_DIR}/CommandAllocatorManager.cpp
|
||||
${D3D12_DIR}/CommandAllocatorManager.h
|
||||
${D3D12_DIR}/CommandBufferD3D12.cpp
|
||||
${D3D12_DIR}/CommandBufferD3D12.h
|
||||
${D3D12_DIR}/ComputePipelineD3D12.cpp
|
||||
${D3D12_DIR}/ComputePipelineD3D12.h
|
||||
${D3D12_DIR}/DepthStencilStateD3D12.cpp
|
||||
${D3D12_DIR}/DepthStencilStateD3D12.h
|
||||
${D3D12_DIR}/DescriptorHeapAllocator.cpp
|
||||
${D3D12_DIR}/DescriptorHeapAllocator.h
|
||||
${D3D12_DIR}/DeviceD3D12.cpp
|
||||
${D3D12_DIR}/DeviceD3D12.h
|
||||
${D3D12_DIR}/Forward.h
|
||||
${D3D12_DIR}/InputStateD3D12.cpp
|
||||
${D3D12_DIR}/InputStateD3D12.h
|
||||
${D3D12_DIR}/NativeSwapChainImplD3D12.cpp
|
||||
${D3D12_DIR}/NativeSwapChainImplD3D12.h
|
||||
${D3D12_DIR}/PipelineLayoutD3D12.cpp
|
||||
${D3D12_DIR}/PipelineLayoutD3D12.h
|
||||
${D3D12_DIR}/PlatformFunctions.cpp
|
||||
${D3D12_DIR}/PlatformFunctions.h
|
||||
${D3D12_DIR}/QueueD3D12.cpp
|
||||
${D3D12_DIR}/QueueD3D12.h
|
||||
${D3D12_DIR}/RenderPassDescriptorD3D12.cpp
|
||||
${D3D12_DIR}/RenderPassDescriptorD3D12.h
|
||||
${D3D12_DIR}/RenderPipelineD3D12.cpp
|
||||
${D3D12_DIR}/RenderPipelineD3D12.h
|
||||
${D3D12_DIR}/ResourceAllocator.cpp
|
||||
${D3D12_DIR}/ResourceAllocator.h
|
||||
${D3D12_DIR}/ResourceUploader.cpp
|
||||
${D3D12_DIR}/ResourceUploader.h
|
||||
${D3D12_DIR}/SamplerD3D12.cpp
|
||||
${D3D12_DIR}/SamplerD3D12.h
|
||||
${D3D12_DIR}/ShaderModuleD3D12.cpp
|
||||
${D3D12_DIR}/ShaderModuleD3D12.h
|
||||
${D3D12_DIR}/SwapChainD3D12.cpp
|
||||
${D3D12_DIR}/SwapChainD3D12.h
|
||||
${D3D12_DIR}/TextureCopySplitter.cpp
|
||||
${D3D12_DIR}/TextureCopySplitter.h
|
||||
${D3D12_DIR}/TextureD3D12.cpp
|
||||
${D3D12_DIR}/TextureD3D12.h
|
||||
${DAWN_NATIVE_INCLUDE_DIR}/D3D12Backend.h
|
||||
)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Vulkan Backend
|
||||
################################################################################
|
||||
|
||||
if (DAWN_ENABLE_VULKAN)
|
||||
list(APPEND DAWN_NATIVE_INCLUDE_DIRS ${VULKAN_HEADERS_INCLUDE_DIR})
|
||||
list(APPEND DAWN_NATIVE_SOURCES
|
||||
${VULKAN_DIR}/BindGroupVk.cpp
|
||||
${VULKAN_DIR}/BindGroupVk.h
|
||||
${VULKAN_DIR}/BindGroupLayoutVk.cpp
|
||||
${VULKAN_DIR}/BindGroupLayoutVk.h
|
||||
${VULKAN_DIR}/BlendStateVk.cpp
|
||||
${VULKAN_DIR}/BlendStateVk.h
|
||||
${VULKAN_DIR}/BufferUploader.cpp
|
||||
${VULKAN_DIR}/BufferUploader.h
|
||||
${VULKAN_DIR}/BufferVk.cpp
|
||||
${VULKAN_DIR}/BufferVk.h
|
||||
${VULKAN_DIR}/CommandBufferVk.cpp
|
||||
${VULKAN_DIR}/CommandBufferVk.h
|
||||
${VULKAN_DIR}/ComputePipelineVk.cpp
|
||||
${VULKAN_DIR}/ComputePipelineVk.h
|
||||
${VULKAN_DIR}/DeviceVk.cpp
|
||||
${VULKAN_DIR}/DeviceVk.h
|
||||
${VULKAN_DIR}/DepthStencilStateVk.cpp
|
||||
${VULKAN_DIR}/DepthStencilStateVk.h
|
||||
${VULKAN_DIR}/FencedDeleter.cpp
|
||||
${VULKAN_DIR}/FencedDeleter.h
|
||||
${VULKAN_DIR}/Forward.h
|
||||
${VULKAN_DIR}/InputStateVk.cpp
|
||||
${VULKAN_DIR}/InputStateVk.h
|
||||
${VULKAN_DIR}/MemoryAllocator.cpp
|
||||
${VULKAN_DIR}/MemoryAllocator.h
|
||||
${VULKAN_DIR}/NativeSwapChainImplVk.cpp
|
||||
${VULKAN_DIR}/NativeSwapChainImplVk.h
|
||||
${VULKAN_DIR}/PipelineLayoutVk.cpp
|
||||
${VULKAN_DIR}/PipelineLayoutVk.h
|
||||
${VULKAN_DIR}/QueueVk.cpp
|
||||
${VULKAN_DIR}/QueueVk.h
|
||||
${VULKAN_DIR}/RenderPassCache.cpp
|
||||
${VULKAN_DIR}/RenderPassCache.h
|
||||
${VULKAN_DIR}/RenderPassDescriptorVk.cpp
|
||||
${VULKAN_DIR}/RenderPassDescriptorVk.h
|
||||
${VULKAN_DIR}/RenderPipelineVk.cpp
|
||||
${VULKAN_DIR}/RenderPipelineVk.h
|
||||
${VULKAN_DIR}/SamplerVk.cpp
|
||||
${VULKAN_DIR}/SamplerVk.h
|
||||
${VULKAN_DIR}/ShaderModuleVk.cpp
|
||||
${VULKAN_DIR}/ShaderModuleVk.h
|
||||
${VULKAN_DIR}/SwapChainVk.cpp
|
||||
${VULKAN_DIR}/SwapChainVk.h
|
||||
${VULKAN_DIR}/TextureVk.cpp
|
||||
${VULKAN_DIR}/TextureVk.h
|
||||
${VULKAN_DIR}/VulkanFunctions.cpp
|
||||
${VULKAN_DIR}/VulkanFunctions.h
|
||||
${VULKAN_DIR}/VulkanInfo.cpp
|
||||
${VULKAN_DIR}/VulkanInfo.h
|
||||
${DAWN_NATIVE_INCLUDE_DIR}/VulkanBackend.h
|
||||
)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Common sources and definition of the library
|
||||
################################################################################
|
||||
|
||||
list(APPEND DAWN_NATIVE_SOURCES
|
||||
${DAWN_NATIVE_DIR}/dawn_platform.h
|
||||
${DAWN_NATIVE_DIR}/BindGroup.cpp
|
||||
${DAWN_NATIVE_DIR}/BindGroup.h
|
||||
${DAWN_NATIVE_DIR}/BindGroupLayout.cpp
|
||||
${DAWN_NATIVE_DIR}/BindGroupLayout.h
|
||||
${DAWN_NATIVE_DIR}/BlendState.cpp
|
||||
${DAWN_NATIVE_DIR}/BlendState.h
|
||||
${DAWN_NATIVE_DIR}/Builder.cpp
|
||||
${DAWN_NATIVE_DIR}/Builder.h
|
||||
${DAWN_NATIVE_DIR}/Buffer.cpp
|
||||
${DAWN_NATIVE_DIR}/Buffer.h
|
||||
${DAWN_NATIVE_DIR}/Commands.cpp
|
||||
${DAWN_NATIVE_DIR}/Commands.h
|
||||
${DAWN_NATIVE_DIR}/CommandAllocator.cpp
|
||||
${DAWN_NATIVE_DIR}/CommandAllocator.h
|
||||
${DAWN_NATIVE_DIR}/CommandBuffer.cpp
|
||||
${DAWN_NATIVE_DIR}/CommandBuffer.h
|
||||
${DAWN_NATIVE_DIR}/ComputePassEncoder.cpp
|
||||
${DAWN_NATIVE_DIR}/ComputePassEncoder.h
|
||||
${DAWN_NATIVE_DIR}/ComputePipeline.cpp
|
||||
${DAWN_NATIVE_DIR}/ComputePipeline.h
|
||||
${DAWN_NATIVE_DIR}/CommandBufferStateTracker.cpp
|
||||
${DAWN_NATIVE_DIR}/CommandBufferStateTracker.h
|
||||
${DAWN_NATIVE_DIR}/DawnNative.cpp
|
||||
${DAWN_NATIVE_DIR}/DepthStencilState.cpp
|
||||
${DAWN_NATIVE_DIR}/DepthStencilState.h
|
||||
${DAWN_NATIVE_DIR}/Device.cpp
|
||||
${DAWN_NATIVE_DIR}/Device.h
|
||||
${DAWN_NATIVE_DIR}/Error.cpp
|
||||
${DAWN_NATIVE_DIR}/Error.h
|
||||
${DAWN_NATIVE_DIR}/ErrorData.cpp
|
||||
${DAWN_NATIVE_DIR}/ErrorData.h
|
||||
${DAWN_NATIVE_DIR}/Forward.h
|
||||
${DAWN_NATIVE_DIR}/InputState.cpp
|
||||
${DAWN_NATIVE_DIR}/InputState.h
|
||||
${DAWN_NATIVE_DIR}/ObjectBase.cpp
|
||||
${DAWN_NATIVE_DIR}/ObjectBase.h
|
||||
${DAWN_NATIVE_DIR}/PassResourceUsage.h
|
||||
${DAWN_NATIVE_DIR}/PerStage.cpp
|
||||
${DAWN_NATIVE_DIR}/PerStage.h
|
||||
${DAWN_NATIVE_DIR}/Pipeline.cpp
|
||||
${DAWN_NATIVE_DIR}/Pipeline.h
|
||||
${DAWN_NATIVE_DIR}/PipelineLayout.cpp
|
||||
${DAWN_NATIVE_DIR}/PipelineLayout.h
|
||||
${DAWN_NATIVE_DIR}/ProgrammablePassEncoder.cpp
|
||||
${DAWN_NATIVE_DIR}/ProgrammablePassEncoder.h
|
||||
${DAWN_NATIVE_DIR}/Queue.cpp
|
||||
${DAWN_NATIVE_DIR}/Queue.h
|
||||
${DAWN_NATIVE_DIR}/RefCounted.cpp
|
||||
${DAWN_NATIVE_DIR}/RefCounted.h
|
||||
${DAWN_NATIVE_DIR}/RenderPassDescriptor.cpp
|
||||
${DAWN_NATIVE_DIR}/RenderPassDescriptor.h
|
||||
${DAWN_NATIVE_DIR}/RenderPassEncoder.cpp
|
||||
${DAWN_NATIVE_DIR}/RenderPassEncoder.h
|
||||
${DAWN_NATIVE_DIR}/RenderPipeline.cpp
|
||||
${DAWN_NATIVE_DIR}/RenderPipeline.h
|
||||
${DAWN_NATIVE_DIR}/Sampler.cpp
|
||||
${DAWN_NATIVE_DIR}/Sampler.h
|
||||
${DAWN_NATIVE_DIR}/ShaderModule.cpp
|
||||
${DAWN_NATIVE_DIR}/ShaderModule.h
|
||||
${DAWN_NATIVE_DIR}/SwapChain.cpp
|
||||
${DAWN_NATIVE_DIR}/SwapChain.h
|
||||
${DAWN_NATIVE_DIR}/Texture.cpp
|
||||
${DAWN_NATIVE_DIR}/Texture.h
|
||||
${DAWN_NATIVE_DIR}/ToBackend.h
|
||||
${DAWN_NATIVE_INCLUDE_DIR}/dawn_native_export.h
|
||||
${DAWN_NATIVE_INCLUDE_DIR}/DawnNative.h
|
||||
)
|
||||
|
||||
# We want to produce both a static and a shared libdawn_native library. The static one is for
|
||||
# unittests that need access to all the symbols of the library. The shared one is for the other
|
||||
# users that access libdawn_native through the regular interface.
|
||||
# We use a CMake "OBJECT" library type which allows precompiling the source files and reusing
|
||||
# them for both the static and the shared library. Recent CMake versions make it so if you
|
||||
# depend on an OBJECT library you get its dependencies and source files, which is very similar to
|
||||
# GN's source_set. However the versions of CMake on our test bots is too old and doesn't support
|
||||
# this, so instead we duplicate the deps everywhere.
|
||||
add_library(libdawn_native_objects OBJECT ${DAWN_NATIVE_SOURCES})
|
||||
DawnInternalTarget("dawn_native" libdawn_native_objects)
|
||||
target_compile_definitions(libdawn_native_objects PRIVATE DAWN_NATIVE_IMPLEMENTATION SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
|
||||
target_include_directories(libdawn_native_objects PRIVATE ${DAWN_NATIVE_INCLUDE_DIRS})
|
||||
add_dependencies(libdawn_native_objects dawn_native_utils_autogen)
|
||||
|
||||
add_library(libdawn_native SHARED $<TARGET_OBJECTS:libdawn_native_objects>)
|
||||
DawnInternalTarget("dawn_native" libdawn_native)
|
||||
target_link_libraries(libdawn_native PRIVATE ${DAWN_NATIVE_DEPS})
|
||||
set_property(TARGET libdawn_native PROPERTY OUTPUT_NAME "dawn_native")
|
||||
|
||||
add_library(libdawn_native_static STATIC $<TARGET_OBJECTS:libdawn_native_objects>)
|
||||
DawnInternalTarget("dawn_native" libdawn_native_static)
|
||||
target_link_libraries(libdawn_native_static ${DAWN_NATIVE_DEPS})
|
||||
@@ -1,37 +0,0 @@
|
||||
# Copyright 2017 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.
|
||||
|
||||
set(DAWN_WIRE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(DAWN_WIRE_INCLUDE_DIR ${INCLUDE_DIR}/dawn_wire)
|
||||
|
||||
Generate(
|
||||
LIB_NAME dawn_wire_autogen
|
||||
LIB_TYPE OBJECT
|
||||
FOLDER "wire"
|
||||
PRINT_NAME "dawn_wire autogenerated files"
|
||||
COMMAND_LINE_ARGS
|
||||
${GENERATOR_COMMON_ARGS}
|
||||
-T dawn_wire
|
||||
)
|
||||
target_compile_definitions(dawn_wire_autogen PRIVATE DAWN_WIRE_IMPLEMENTATION)
|
||||
|
||||
add_library(dawn_wire SHARED
|
||||
$<TARGET_OBJECTS:dawn_wire_autogen>
|
||||
${DAWN_WIRE_DIR}/WireCmd.h
|
||||
${DAWN_WIRE_INCLUDE_DIR}/Wire.h
|
||||
${DAWN_WIRE_INCLUDE_DIR}/dawn_wire_export.h
|
||||
)
|
||||
target_link_libraries(dawn_wire PRIVATE dawn_common)
|
||||
target_compile_definitions(dawn_wire PRIVATE DAWN_WIRE_IMPLEMENTATION)
|
||||
DawnInternalTarget("wire" dawn_wire)
|
||||
@@ -1,94 +0,0 @@
|
||||
# Copyright 2017 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.
|
||||
|
||||
Generate(
|
||||
LIB_NAME mock_dawn
|
||||
LIB_TYPE STATIC
|
||||
FOLDER "tests"
|
||||
PRINT_NAME libMockDawn
|
||||
COMMAND_LINE_ARGS
|
||||
${GENERATOR_COMMON_ARGS}
|
||||
-T mock_dawn
|
||||
)
|
||||
target_link_libraries(mock_dawn gtest)
|
||||
|
||||
set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(UNITTESTS_DIR ${TESTS_DIR}/unittests)
|
||||
set(VALIDATION_TESTS_DIR ${UNITTESTS_DIR}/validation)
|
||||
set(END2END_TESTS_DIR ${TESTS_DIR}/end2end)
|
||||
|
||||
list(APPEND UNITTEST_SOURCES
|
||||
${UNITTESTS_DIR}/BitSetIteratorTests.cpp
|
||||
${UNITTESTS_DIR}/CommandAllocatorTests.cpp
|
||||
${UNITTESTS_DIR}/EnumClassBitmasksTests.cpp
|
||||
${UNITTESTS_DIR}/ErrorTests.cpp
|
||||
${UNITTESTS_DIR}/MathTests.cpp
|
||||
${UNITTESTS_DIR}/ObjectBaseTests.cpp
|
||||
${UNITTESTS_DIR}/PerStageTests.cpp
|
||||
${UNITTESTS_DIR}/RefCountedTests.cpp
|
||||
${UNITTESTS_DIR}/ResultTests.cpp
|
||||
${UNITTESTS_DIR}/SerialQueueTests.cpp
|
||||
${UNITTESTS_DIR}/ToBackendTests.cpp
|
||||
${UNITTESTS_DIR}/WireTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/BindGroupValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/BlendStateValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/BufferValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/CommandBufferValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/ComputeValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/CopyCommandsValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/DepthStencilStateValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/DynamicStateCommandValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/InputStateValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/PushConstantsValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/RenderPassDescriptorValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/RenderPipelineValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/ShaderModuleValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/VertexBufferValidationTests.cpp
|
||||
${VALIDATION_TESTS_DIR}/ValidationTest.cpp
|
||||
${VALIDATION_TESTS_DIR}/ValidationTest.h
|
||||
${TESTS_DIR}/UnittestsMain.cpp
|
||||
)
|
||||
|
||||
if (DAWN_ENABLE_D3D12)
|
||||
list(APPEND UNITTEST_SOURCES
|
||||
${UNITTESTS_DIR}/d3d12/CopySplitTests.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(dawn_unittests ${UNITTEST_SOURCES})
|
||||
target_link_libraries(dawn_unittests dawn_common gtest libdawn_native_static mock_dawn dawn_wire utils)
|
||||
DawnInternalTarget("tests" dawn_unittests)
|
||||
|
||||
add_executable(dawn_end2end_tests
|
||||
${END2END_TESTS_DIR}/BasicTests.cpp
|
||||
${END2END_TESTS_DIR}/BufferTests.cpp
|
||||
${END2END_TESTS_DIR}/BlendStateTests.cpp
|
||||
${END2END_TESTS_DIR}/ComputeCopyStorageBufferTests.cpp
|
||||
${END2END_TESTS_DIR}/CopyTests.cpp
|
||||
${END2END_TESTS_DIR}/DrawElementsTests.cpp
|
||||
${END2END_TESTS_DIR}/DepthStencilStateTests.cpp
|
||||
${END2END_TESTS_DIR}/IndexFormatTests.cpp
|
||||
${END2END_TESTS_DIR}/InputStateTests.cpp
|
||||
${END2END_TESTS_DIR}/PrimitiveTopologyTests.cpp
|
||||
${END2END_TESTS_DIR}/PushConstantTests.cpp
|
||||
${END2END_TESTS_DIR}/RenderPassLoadOpTests.cpp
|
||||
${END2END_TESTS_DIR}/ScissorTests.cpp
|
||||
${END2END_TESTS_DIR}/SamplerTests.cpp
|
||||
${END2END_TESTS_DIR}/ViewportOrientationTests.cpp
|
||||
${TESTS_DIR}/End2EndTestsMain.cpp
|
||||
${TESTS_DIR}/DawnTest.cpp
|
||||
${TESTS_DIR}/DawnTest.h
|
||||
)
|
||||
target_link_libraries(dawn_end2end_tests dawn_common dawn_wire gtest utils)
|
||||
DawnInternalTarget("tests" dawn_end2end_tests)
|
||||
@@ -1,85 +0,0 @@
|
||||
# Copyright 2017 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.
|
||||
|
||||
set(UTILS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
list(APPEND UTILS_SOURCES
|
||||
${UTILS_DIR}/BackendBinding.cpp
|
||||
${UTILS_DIR}/BackendBinding.h
|
||||
${UTILS_DIR}/DawnHelpers.cpp
|
||||
${UTILS_DIR}/DawnHelpers.h
|
||||
${UTILS_DIR}/SystemUtils.cpp
|
||||
${UTILS_DIR}/SystemUtils.h
|
||||
${UTILS_DIR}/TerribleCommandBuffer.cpp
|
||||
${UTILS_DIR}/TerribleCommandBuffer.h
|
||||
)
|
||||
|
||||
list(APPEND UTILS_DEPS
|
||||
dawn_common
|
||||
libdawn_native
|
||||
shaderc_shared
|
||||
libdawn
|
||||
glfw
|
||||
)
|
||||
|
||||
set(UTILS_INCLUDE_DIRS)
|
||||
|
||||
if (DAWN_ENABLE_D3D12)
|
||||
list(APPEND UTILS_SOURCES
|
||||
${UTILS_DIR}/D3D12Binding.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (DAWN_ENABLE_METAL)
|
||||
list(APPEND UTILS_SOURCES
|
||||
${UTILS_DIR}/MetalBinding.mm
|
||||
)
|
||||
list(APPEND UTILS_DEPS
|
||||
"-framework Metal"
|
||||
"-framework QuartzCore"
|
||||
)
|
||||
endif()
|
||||
|
||||
if (DAWN_ENABLE_NULL)
|
||||
list(APPEND UTILS_SOURCES
|
||||
${UTILS_DIR}/NullBinding.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (DAWN_ENABLE_OPENGL)
|
||||
list(APPEND UTILS_SOURCES
|
||||
${UTILS_DIR}/OpenGLBinding.cpp
|
||||
)
|
||||
list(APPEND UTILS_DEPS
|
||||
glad
|
||||
)
|
||||
endif()
|
||||
|
||||
if (DAWN_ENABLE_VULKAN)
|
||||
list(APPEND UTILS_SOURCES
|
||||
${UTILS_DIR}/VulkanBinding.cpp
|
||||
)
|
||||
list(APPEND UTILS_INCLUDE_DIRS
|
||||
${VULKAN_HEADERS_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(utils STATIC ${UTILS_SOURCES})
|
||||
target_link_libraries(utils ${UTILS_DEPS})
|
||||
target_include_directories(utils PRIVATE ${UTILS_INCLUDE_DIRS})
|
||||
DawnInternalTarget("" utils)
|
||||
if(NOT MSVC)
|
||||
# allow C-style casts -- for shaderc
|
||||
set_property(TARGET utils APPEND PROPERTY COMPILE_OPTIONS "-Wno-old-style-cast")
|
||||
endif()
|
||||
Reference in New Issue
Block a user