Working LSP with test webgpu build

This commit is contained in:
Warwick 2025-04-16 16:34:19 +01:00
parent b281bc04ce
commit 5b48d72196
2 changed files with 15 additions and 2 deletions

View file

@ -7,7 +7,14 @@ project(webgpu
)
set(CMAKE_C_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Since nix include dirs isn't appearing in compile_commands.json we're gonna
# force cmake to link it's includes explicitly
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
if(CMAKE_EXPORT_COMPILE_COMMANDS)
set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES
${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
endif()
# Error on memory address issues in debug mode
if(CMAKE_BUILD_TYPE MATCHES "Debug")

View file

@ -2,6 +2,12 @@
#include <webgpu/webgpu.h>
int main() {
// We create a descriptor
WGPUInstanceDescriptor desc = {};
desc.nextInChain = NULL;
// We create the instance using this descriptor
WGPUInstance instance = wgpuCreateInstance(&desc);
printf("Hello World!\n");
return 0;
}