File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.13 )
2
2
3
- find_package (Dawn REQUIRED )
4
3
find_package (Python3 REQUIRED )
5
4
6
5
# Shader locations
@@ -37,9 +36,19 @@ ggml_add_backend_library(ggml-webgpu
37
36
38
37
add_dependencies (ggml-webgpu generate_shaders )
39
38
39
+ if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" )
40
+ set (EMDAWNWEBGPU_DIR "" CACHE PATH "Path to emdawnwebgpu_pkg" )
41
+
42
+ target_compile_options (ggml-webgpu PRIVATE "--use-port=${EMDAWNWEBGPU_DIR} /emdawnwebgpu.port.py" )
43
+ target_link_options (ggml-webgpu PRIVATE "--use-port=${EMDAWNWEBGPU_DIR} /emdawnwebgpu.port.py" )
44
+ else ()
45
+ find_package (Dawn REQUIRED )
46
+ set (DawnWebGPU_TARGET dawn::webgpu_dawn )
47
+ endif ()
48
+
40
49
if (GGML_WEBGPU_DEBUG )
41
50
target_compile_definitions (ggml-webgpu PRIVATE GGML_WEBGPU_DEBUG=1 )
42
51
endif ()
43
52
44
53
target_include_directories (ggml-webgpu PRIVATE ${SHADER_OUTPUT_DIR} )
45
- target_link_libraries (ggml-webgpu PRIVATE dawn::webgpu_dawn )
54
+ target_link_libraries (ggml-webgpu PRIVATE ${DawnWebGPU_TARGET} )
Original file line number Diff line number Diff line change 1
1
#include " ggml-webgpu.h"
2
2
3
3
#include < webgpu/webgpu_cpp.h>
4
- #include < webgpu/webgpu_cpp_print.h>
5
4
6
5
#include " ggml-impl.h"
7
6
#include " ggml-backend-impl.h"
You can’t perform that action at this time.
0 commit comments