Created
June 8, 2023 23:07
-
-
Save sortofsleepy/393eee084f1005d13d3146579598d869 to your computer and use it in GitHub Desktop.
Building Google Dawn w/ CMake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.25) | |
project(dawn_compile) | |
set(CMAKE_CXX_STANDARD 17) | |
add_executable(dawn_compile main.cpp) | |
include_directories(dawn_compile ${CMAKE_CURRENT_SOURCE_DIR}/libraries/dawn/include) | |
include_directories(dawn_compile ${CMAKE_CURRENT_SOURCE_DIR}/libraries/dawn/gen/include) | |
# 12-16 Assumes you built with DirectX - adjust as needed | |
find_library(DIRECTX_LIBRARY NAMES d3d11) | |
find_library(DIRECTX_DXGUID NAMES dxguid) | |
target_link_libraries(dawn_compile "${DIRECTX_LIBRARY}") | |
target_link_libraries(dawn_compile "${DIRECTX_DXGUID}") | |
target_link_libraries(dawn_compile libraries/libs/webgpu_dawn.lib) | |
target_link_libraries(dawn_compile libraries/libs/dawn_native.lib) | |
target_link_libraries(dawn_compile libraries/libs/dawn_common.lib) | |
target_link_libraries(dawn_compile libraries/libs/dawn_headers.lib) | |
target_link_libraries(dawn_compile libraries/libs/dawn_platform.lib) | |
target_link_libraries(dawn_compile libraries/libs/dawn_proc.lib) | |
target_link_libraries(dawn_compile libraries/libs/dawncpp.lib) | |
target_link_libraries(dawn_compile libraries/libs/dawncpp_headers.lib) | |
target_link_libraries(dawn_compile libraries/libs/tint.lib) | |
target_link_libraries(dawn_compile libraries/libs/tint_utils_io.lib) | |
target_link_libraries(dawn_compile libraries/libs/tint_val.lib) | |
target_link_libraries(dawn_compile libraries/libs/tint_diagnostic_utils.lib) | |
target_link_libraries(dawn_compile libraries/libs/absl_str_format_internal.lib) | |
target_link_libraries(dawn_compile libraries/libs/absl_strings.lib) | |
target_link_libraries(dawn_compile libraries/libs/absl_base.lib) | |
target_link_libraries(dawn_compile libraries/libs/absl_strings_internal.lib) | |
target_link_libraries(dawn_compile libraries/libs/absl_int128.lib) | |
target_link_libraries(dawn_compile libraries/libs/absl_malloc_internal.lib) | |
target_link_libraries(dawn_compile libraries/libs/absl_raw_logging_internal.lib) | |
target_link_libraries(dawn_compile libraries/libs/absl_throw_delegate.lib) | |
target_link_libraries(dawn_compile libraries/libs/SPIRV-Tools.lib) | |
target_link_libraries(dawn_compile libraries/libs/SPIRV-Tools-opt.lib) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is more for my own reference but for anyone that stumbles across this - this is so far the basics of what's needed to compile a standard build of Google's Dawn library as of 6/8/2023.
This assumes some things
libraries
at your rootAs far as header files, I have the
include
folder at the root of the Dawn repo in the root of my project folder. I also include thegen
folder that is generated once you build Dawn. The project folder basically looks likeSo far this is enough to declare a
dawn::native::Instance
object without errors; that said it might still need more adjustments for Dawn to be fully usable.Adjust as needed