mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
Add UWP compilation support in CMake
Set BUILD_EXAMPLE to OFF in UWP. Disable Vulkan in UWP. Compile GLFW related sources only on supported platform. Remove linking to user32.lib in UWP. Add linking to dxgi.lib only in debug configuration. Use EmptyDebugLogger in UWP. Bug: dawn:766 Change-Id: I3e6149058048d1b597267dfb9d63342b6a54e0af Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55260 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
@@ -14,14 +14,10 @@
|
||||
|
||||
add_library(dawn_utils STATIC ${DAWN_DUMMY_FILE})
|
||||
target_sources(dawn_utils PRIVATE
|
||||
"BackendBinding.cpp"
|
||||
"BackendBinding.h"
|
||||
"ComboRenderBundleEncoderDescriptor.cpp"
|
||||
"ComboRenderBundleEncoderDescriptor.h"
|
||||
"ComboRenderPipelineDescriptor.cpp"
|
||||
"ComboRenderPipelineDescriptor.h"
|
||||
"GLFWUtils.cpp"
|
||||
"GLFWUtils.h"
|
||||
"PlatformDebugLogger.h"
|
||||
"SystemUtils.cpp"
|
||||
"SystemUtils.h"
|
||||
@@ -48,7 +44,7 @@ target_link_libraries(dawn_utils
|
||||
glfw
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
if(WIN32 AND NOT WINDOWS_STORE)
|
||||
target_sources(dawn_utils PRIVATE "WindowsDebugLogger.cpp")
|
||||
else()
|
||||
target_sources(dawn_utils PRIVATE "EmptyDebugLogger.cpp")
|
||||
@@ -67,26 +63,39 @@ elseif(UNIX)
|
||||
target_sources(dawn_utils PRIVATE "PosixTimer.cpp")
|
||||
endif()
|
||||
|
||||
if (DAWN_ENABLE_D3D12)
|
||||
target_sources(dawn_utils PRIVATE "D3D12Binding.cpp")
|
||||
endif()
|
||||
|
||||
if (DAWN_ENABLE_METAL)
|
||||
target_sources(dawn_utils PRIVATE
|
||||
"GLFWUtils_metal.mm"
|
||||
"MetalBinding.mm"
|
||||
)
|
||||
target_link_libraries(dawn_utils PRIVATE "-framework Metal")
|
||||
endif()
|
||||
|
||||
if (DAWN_ENABLE_NULL)
|
||||
target_sources(dawn_utils PRIVATE "NullBinding.cpp")
|
||||
endif()
|
||||
if(DAWN_SUPPORTS_GLFW_FOR_WINDOWING)
|
||||
target_sources(dawn_utils PRIVATE
|
||||
"BackendBinding.cpp"
|
||||
"BackendBinding.h"
|
||||
"GLFWUtils.cpp"
|
||||
"GLFWUtils.h"
|
||||
)
|
||||
target_link_libraries(dawn_utils PRIVATE glfw)
|
||||
|
||||
if (DAWN_ENABLE_OPENGL)
|
||||
target_sources(dawn_utils PRIVATE "OpenGLBinding.cpp")
|
||||
endif()
|
||||
if (DAWN_ENABLE_D3D12)
|
||||
target_sources(dawn_utils PRIVATE "D3D12Binding.cpp")
|
||||
endif()
|
||||
|
||||
if (DAWN_ENABLE_VULKAN)
|
||||
target_sources(dawn_utils PRIVATE "VulkanBinding.cpp")
|
||||
if (DAWN_ENABLE_METAL)
|
||||
target_sources(dawn_utils PRIVATE
|
||||
"GLFWUtils_metal.mm"
|
||||
"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()
|
||||
|
||||
Reference in New Issue
Block a user