Closed Laxystem closed 1 year ago
Hello! Can you show the content of the webgpu directory and in particular the cake files in there?
Hello! Can you show the content of the webgpu directory and in particular the cake files in there?
I meant the content of the files ^^ Make sure to use the last version of WebGPU-distribution (where did you get these fils from exactly? I try to keep everything up to date as much as possible but since at the same time I'm trying to follow the changes in WebGPU API there are likely outdated things that I lost track of!)
set(WGPU ${CMAKE_CURRENT_SOURCE_DIR})
if (NOT ARCH)
set(ARCH x86_64)
endif()
# A pre-compiled target (IMPORTED) that is a dynamically
# linked library (SHARED, meaning .dll, .so or .dylib).
add_library(webgpu SHARED IMPORTED GLOBAL)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(WGPU_RUNTIME_LIB ${WGPU}/windows-${ARCH}/wgpu_native.dll PARENT_SCOPE)
set_target_properties(
webgpu
PROPERTIES
IMPORTED_LOCATION "${WGPU_RUNTIME_LIB}"
IMPORTED_IMPLIB "${WGPU}/windows-${ARCH}/wgpu_native.lib"
INTERFACE_INCLUDE_DIRECTORIES "${WGPU}"
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(WGPU_RUNTIME_LIB ${WGPU}/linux-${ARCH}/libwgpu.so PARENT_SCOPE)
set_target_properties(
webgpu
PROPERTIES
IMPORTED_LOCATION "${WGPU_RUNTIME_LIB}"
INTERFACE_INCLUDE_DIRECTORIES "${WGPU}"
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(WGPU_RUNTIME_LIB ${WGPU}/macos-${ARCH}/libwgpu.dylib PARENT_SCOPE)
set_target_properties(
webgpu
PROPERTIES
IMPORTED_LOCATION "${WGPU_RUNTIME_LIB}"
INTERFACE_INCLUDE_DIRECTORIES "${WGPU}"
)
else()
message(FATAL_ERROR "Plateform not supported by this release of WebGPU. You may consider building it yourself from its source (see https://github.com/gfx-rs/wgpu-native)")
endif()
# The application's binary must find wgpu.dll or libwgpu.so at runtime,
# so we automatically copy it (it's called WGPU_RUNTIME_LIB in general)
# next to the binary.
function(target_copy_webgpu_binaries Target)
add_custom_command(
TARGET ${Target} POST_BUILD
COMMAND
${CMAKE_COMMAND} -E copy_if_different
${WGPU_RUNTIME_LIB}
$<TARGET_FILE_DIR:${Target}>
)
endfunction()
Here it is, sorry!
And I got it from this link on your tutorial.
thank you for replying so quickly, btw.
You should use this version of the distribution that is more up to date: https://github.com/eliemichel/WebGPU-distribution/tree/wgpu (I believe there is a warning a bit below the link you've used to tell that only one of the download links is up to date for now but I agree it could be clearer)
If you're not on Linux the problem is that you are missing the lib file of your os (but again use the up to date version ;) )
It works now, thanks! Although it does funny stuff when you don't write to the GLFW buffer ;3
My
CMakeLists.txt
: