FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gpu.cpp/cmake/webgpu.cmake at main · fzallocco/gpu.cpp · GitHub
fzallocco
/
gpu.cpp
Public
forked from
AnswerDotAI/gpu.cpp
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
gpu.cpp
/
cmake
/
webgpu.cmake
Copy path
More file actions
More file actions
Latest commit
History
History
History
55 lines (45 loc) · 1.83 KB
Breadcrumbs
gpu.cpp
/
cmake
/
webgpu.cmake
Copy path
File metadata and controls
55 lines (45 loc) · 1.83 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
Specify the filename to search for
set
(FILENAME
"gpu.hpp"
)
get_filename_component
(
PROJECT_ROOT
${
CMAKE_CURRENT_SOURCE_DIR
}
DIRECTORY
)
get_filename_component
(
PROJECT_ROOT
${PROJECT_ROOT}
DIRECTORY
)
#
Construct potential paths
set
(FILEPATH_CURRENT_DIR
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${FILENAME}
"
)
set
(FILEPATH_PROJECT_ROOT
"
${PROJECT_ROOT}
/
${FILENAME}
"
)
#
Include file finding utility script
include
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/find_gpu.cmake"
)
#
Check if the file exists in the current directory
find_project_root
(
${
CMAKE_CURRENT_SOURCE_DIR
}
${FILENAME}
TARGET_FILE_PATH
)
if
(
"
${TARGET_FILE_PATH}
"
STREQUAL
""
)
find_project_root
(
${FILEPATH_CURRENT_DIR}
${FILENAME}
TARGET_FILE_PATH
)
if
(
"
${TARGET_FILE_PATH}
"
STREQUAL
""
)
message
(
FATAL_ERROR
"File
${FILENAME}
not found in either
${
CMAKE_CURRENT_SOURCE_DIR
}
or
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../"
)
endif
()
endif
()
include
(
FetchContent
)
set
(FETCHCONTENT_BASE_DIR
"
${TARGET_FILE_PATH}
/third_party/fetchcontent"
)
set
(WEBGPU_DIST_LOCAL_PATH
"
${TARGET_FILE_PATH}
/third_party/local/WebGPU-distribution"
)
if
(USE_LOCAL_LIBS)
set
(WEBGPU_DIST_GIT_REPO
${WEBGPU_DIST_LOCAL_PATH}
)
message
(
STATUS
"Using local WebGPU distribution:
${WEBGPU_DIST_LOCAL_PATH}
"
)
else
()
set
(WEBGPU_DIST_GIT_REPO
"https://github.com/eliemichel/WebGPU-distribution"
)
endif
()
option
(
WEBGPU_TAG
"WebGPU distribution tag to use"
)
if
(
NOT
WEBGPU_TAG)
set
(WEBGPU_TAG
"main"
)
endif
()
message
(
STATUS
"Using WebGPU distribution tag:
${WEBGPU_TAG}
"
)
set
(WEBGPU_BACKEND
"DAWN"
CACHE
STRING
"WebGPU backend"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DWEBGPU_BACKEND_DAWN"
)
message
(
STATUS
"Using Dawn backend"
)
FetchContent_Declare
(
webgpu
GIT_REPOSITORY
${WEBGPU_DIST_GIT_REPO}
GIT_TAG
${WEBGPU_TAG}
GIT_SHALLOW
TRUE
)
FetchContent_MakeAvailable
(webgpu)
Back
|
FazBrowse Home
|
New Git URL