-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
59 lines (45 loc) · 1.45 KB
/
Copy pathCMakeLists.txt
File metadata and controls
59 lines (45 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
cmake_minimum_required(VERSION 3.0...3.25)
project(
BaseWebGPU # name of project / VS solution
VERSION 0.1.0
LANGUAGES CXX C # programming languages used by the project
)
if (NOT EMSCRIPTEN)
# Add the 'glfw' directory, which contains the definition of a 'glfw' target
add_subdirectory(glfw)
else()
# Create a mock 'glfw' target that just sets the `-sUSE_GLFW=3` link option:
add_library(glfw INTERFACE)
target_link_options(glfw INTERFACE -sUSE_GLFW=3)
endif()
# Include webgpu directory, to define the 'webgpu' target
add_subdirectory(webgpu)
add_subdirectory(glfw3webgpu)
add_executable(App
Main.cpp
webgpu-utils.h
webgpu-utils.cpp
FileManagement.h
FileManagement.cpp
Camera.h
Camera.cpp
Application.h
Application.cpp
Dependencies.cpp
)
# Add the 'webgpu' target as a dependency of our App
target_link_libraries(App PRIVATE webgpu glfw glfw3webgpu)
# look for includes in the current directory
target_include_directories(App PRIVATE .)
# 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.
target_copy_webgpu_binaries(App)
set_target_properties(App PROPERTIES
CXX_STANDARD 17 # required minimum standard is CPP17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
COMPILE_WARNING_AS_ERROR ON
)
# Enable the use of emscripten_sleep()
target_link_options(App PRIVATE -sASYNCIFY)