From 215b5370bc4fa9dc5eb0004a0a21b9245296d04b Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Sat, 15 Feb 2020 00:39:13 +0000 Subject: [PATCH] CMake: Add support for the OpenGL backend Bug: dawn:333 Change-Id: Ic5386dc2fda3ba21f1437ee0b2c3f508ffb9dff7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15940 Commit-Queue: Kai Ninomiya Reviewed-by: Austin Eng Reviewed-by: Kai Ninomiya --- src/dawn_native/CMakeLists.txt | 45 +++++++++++++++++++++++++++++++++- third_party/CMakeLists.txt | 5 ++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/dawn_native/CMakeLists.txt b/src/dawn_native/CMakeLists.txt index 004c00af5c..552b5eea35 100644 --- a/src/dawn_native/CMakeLists.txt +++ b/src/dawn_native/CMakeLists.txt @@ -211,7 +211,50 @@ if (DAWN_ENABLE_OPENGL) RESULT_VARIABLE "DAWN_NATIVE_OPENGL_AUTOGEN_SOURCES" ) - # TODO + target_sources(dawn_native PRIVATE + "${DAWN_INCLUDE_DIR}/dawn_native/OpenGLBackend.h" + ${DAWN_NATIVE_OPENGL_AUTOGEN_SOURCES} + "opengl/BackendGL.cpp" + "opengl/BackendGL.h" + "opengl/BufferGL.cpp" + "opengl/BufferGL.h" + "opengl/CommandBufferGL.cpp" + "opengl/CommandBufferGL.h" + "opengl/ComputePipelineGL.cpp" + "opengl/ComputePipelineGL.h" + "opengl/DeviceGL.cpp" + "opengl/DeviceGL.h" + "opengl/Forward.h" + "opengl/GLFormat.cpp" + "opengl/GLFormat.h" + "opengl/NativeSwapChainImplGL.cpp" + "opengl/NativeSwapChainImplGL.h" + "opengl/OpenGLFunctions.cpp" + "opengl/OpenGLFunctions.h" + "opengl/PersistentPipelineStateGL.cpp" + "opengl/PersistentPipelineStateGL.h" + "opengl/PipelineGL.cpp" + "opengl/PipelineGL.h" + "opengl/PipelineLayoutGL.cpp" + "opengl/PipelineLayoutGL.h" + "opengl/QueueGL.cpp" + "opengl/QueueGL.h" + "opengl/RenderPipelineGL.cpp" + "opengl/RenderPipelineGL.h" + "opengl/SamplerGL.cpp" + "opengl/SamplerGL.h" + "opengl/ShaderModuleGL.cpp" + "opengl/ShaderModuleGL.h" + "opengl/SwapChainGL.cpp" + "opengl/SwapChainGL.h" + "opengl/TextureGL.cpp" + "opengl/TextureGL.h" + "opengl/UtilsGL.cpp" + "opengl/UtilsGL.h" + "opengl/opengl_platform.h" + ) + + target_link_libraries(dawn_native PRIVATE dawn_khronos_platform) endif() if (DAWN_ENABLE_VULKAN) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 54484fabf2..56993a1f8a 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -72,3 +72,8 @@ if (DAWN_BUILD_EXAMPLES) add_subdirectory(${DAWN_GLM_DIR}) endif() endif() + +# Header-only library for khrplatform.h +add_library(dawn_khronos_platform INTERFACE) +target_sources(dawn_khronos_platform INTERFACE "${DAWN_THIRD_PARTY_DIR}/khronos/KHR/khrplatform.h") +target_include_directories(dawn_khronos_platform INTERFACE "${DAWN_THIRD_PARTY_DIR}/khronos")