Skip to content

Instantly share code, notes, and snippets.

@wcandillon
Created June 27, 2024 12:23
Show Gist options
  • Save wcandillon/d22b3c5852accc3f69571d6607a57e6f to your computer and use it in GitHub Desktop.
Save wcandillon/d22b3c5852accc3f69571d6607a57e6f to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 3.22.1)
cmake_policy(SET CMP0048 NEW)
project(webgpu VERSION 1.1.0 LANGUAGES CXX)
include(${CMAKE_CURRENT_LIST_DIR}/BundleLibraries.cmake)
set(DAWN_BUILD_ANDROID_SAMPLES OFF)
set(DAWN_BUILD_SAMPLES OFF)
set(TINT_BUILD_TESTS OFF)
set(TINT_BUILD_CMD_TOOLS OFF)
add_subdirectory(../../../externals/dawn/ dawn)
add_library(native_dawn main.cpp)
target_link_libraries(native_dawn webgpu_dawn)
bundle_libraries(webgpu_c_bundled native_dawn)
if(ANDROID)
find_library(log-lib log)
target_link_libraries(webgpu_c_bundled ${log-lib} android)
elseif(IOS)
target_link_libraries(webgpu_c_bundled "-framework CoreFoundation" "-framework IOSurface" "-framework Metal" "-framework QuartzCore" "-framework Foundation")
endif()
@jspanchu
Copy link

ran into various problems after i changed dawn to hide symbols by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment