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 <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Corentin Wallez 2020-02-15 00:39:13 +00:00 committed by Commit Bot service account
parent 71b3dd56da
commit 215b5370bc
2 changed files with 49 additions and 1 deletions

View File

@ -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)

View File

@ -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")