dawn-cmake/src/dawn/utils/CMakeLists.txt
dan sinclair 52cc4f5d1c Add a target for the GLFW surface helper.
This CL moves the GLFWUtils.cpp into a dawn/glfw/utils.cpp and
GLFWUtils.h into include/webgpu/webgpu_glfw.h. A build target
(`webgpu_glfw` alias to `dawn_glfw`) is added in order to allow
using that target in downstream projects without having to re-implement.

Change-Id: I93e85d5af3f486b3c754f2f854aafbda51901d6d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98700
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-08-14 15:59:25 +00:00

101 lines
2.7 KiB
CMake

# Copyright 2020 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.
add_library(dawn_utils STATIC ${DAWN_PLACEHOLDER_FILE})
common_compile_options(dawn_utils)
target_sources(dawn_utils PRIVATE
"ComboRenderBundleEncoderDescriptor.cpp"
"ComboRenderBundleEncoderDescriptor.h"
"ComboRenderPipelineDescriptor.cpp"
"ComboRenderPipelineDescriptor.h"
"PlatformDebugLogger.h"
"ScopedAutoreleasePool.cpp"
"ScopedAutoreleasePool.h"
"SystemUtils.cpp"
"SystemUtils.h"
"TerribleCommandBuffer.cpp"
"TerribleCommandBuffer.h"
"TestUtils.cpp"
"TestUtils.h"
"TextureUtils.cpp"
"TextureUtils.h"
"Timer.h"
"WGPUHelpers.cpp"
"WGPUHelpers.h"
"WireHelper.cpp"
"WireHelper.h"
)
target_link_libraries(dawn_utils
PUBLIC dawncpp_headers
PRIVATE dawn_internal_config
dawn_common
dawn_native
dawn_proc
dawn_wire
SPIRV-Tools-opt
)
if(WIN32 AND NOT WINDOWS_STORE)
target_sources(dawn_utils PRIVATE "WindowsDebugLogger.cpp")
else()
target_sources(dawn_utils PRIVATE "EmptyDebugLogger.cpp")
endif()
if(WIN32)
target_sources(dawn_utils PRIVATE "WindowsTimer.cpp")
elseif(APPLE)
target_sources(dawn_utils PRIVATE
"OSXTimer.cpp"
"ObjCUtils.h"
"ObjCUtils.mm"
)
target_link_libraries(dawn_utils PRIVATE "-framework QuartzCore")
elseif(UNIX)
target_sources(dawn_utils PRIVATE "PosixTimer.cpp")
endif()
if (DAWN_ENABLE_METAL)
target_link_libraries(dawn_utils PRIVATE "-framework Metal")
endif()
if(DAWN_SUPPORTS_GLFW_FOR_WINDOWING)
target_sources(dawn_utils PRIVATE
"BackendBinding.cpp"
"BackendBinding.h"
)
target_link_libraries(dawn_utils PRIVATE glfw)
if (DAWN_ENABLE_D3D12)
target_sources(dawn_utils PRIVATE "D3D12Binding.cpp")
endif()
if (DAWN_ENABLE_METAL)
target_sources(dawn_utils PRIVATE
"MetalBinding.mm"
)
endif()
if (DAWN_ENABLE_NULL)
target_sources(dawn_utils PRIVATE "NullBinding.cpp")
endif()
if (DAWN_ENABLE_OPENGL)
target_sources(dawn_utils PRIVATE "OpenGLBinding.cpp")
endif()
if (DAWN_ENABLE_VULKAN)
target_sources(dawn_utils PRIVATE "VulkanBinding.cpp")
endif()
endif()