Skip to content

Commit

Permalink
release and debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed Jun 14, 2024
1 parent c20f4cb commit 570922b
Show file tree
Hide file tree
Showing 15 changed files with 3,514 additions and 4,575 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/out/
/out/*/*
!/out/webdbg/hello.html
!/out/webdbg/hello.js
!/out/webdbg/hello.wasm
!/out/webdbg/hello.wasm.map
!/out/webrel/hello.html
!/out/webrel/hello.js
!/out/webrel/hello.wasm
/third_party/dawn/
30 changes: 20 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ if(NOT EMSCRIPTEN)
endif()

if(EMSCRIPTEN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")
add_compile_options(
"-Wall"
"-Wextra"
"$<$<CONFIG:Release>:-flto>"
)
endif()

add_executable(hello
Expand All @@ -45,15 +49,21 @@ if(EMSCRIPTEN)
set_target_properties(hello PROPERTIES
SUFFIX ".html")
target_link_options(hello
# To enable DWARF debugging, remove -gsource-map and follow:
# https://developer.chrome.com/blog/wasm-debugging-2020/
PRIVATE "-gsource-map"
#PRIVATE "--source-map-base=./"
PRIVATE "-sUSE_WEBGPU=1"
PRIVATE "-sASSERTIONS=1"
PRIVATE "-sSAFE_HEAP=1"
#PRIVATE "--closure=1"
#PRIVATE "-sVERBOSE=1"
PRIVATE
# To enable DWARF debugging, remove -gsource-map and follow:
# https://developer.chrome.com/blog/wasm-debugging-2020/
"$<$<CONFIG:Debug>:-gsource-map>"
#"$<$<CONFIG:Debug>:--source-map-base=./>"

"-sUSE_WEBGPU=1"

"$<$<CONFIG:Debug>:-sASSERTIONS=1>"
"$<$<CONFIG:Debug>:-sSAFE_HEAP=1>"
"$<$<CONFIG:Release>:-flto>"
"$<$<CONFIG:Release>:--closure=1>"

# Verbose compilation output
#"-sVERBOSE=1"
)
else()
target_link_libraries(hello
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ but that is a goal.

**Check the [issues](https://github.com/kainino0x/webgpu-cross-platform-demo/issues) tab for known issues.**

**Please note the `webgpu.h` and `webgpu_cpp.h` APIs (implemented by Dawn/wgpu-native/Emscripten) are not yet stabilized.**
**Please note the `webgpu.h` API (implemented by Dawn/wgpu-native/Emscripten) and `webgpu_cpp.h` bindings (from Dawn) are not yet stabilized.**

## Open pre-installed VSCode in Browser
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/kainino0x/webgpu-cross-platform-demo)
Expand Down
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<html>
<head>
<meta charset=utf-8>
<meta http-equiv="refresh" content="0;URL=./out/web/hello.html" />
<title></title>
<title>webgpu-cross-platform-demo</title>
</head>
<body>
<h1><a href=out/webrel/hello.html>Release build</a></h1>
<h1><a href=out/webdbg/hello.html>Debug build</a></h1>
</body>
</html>
1,294 changes: 0 additions & 1,294 deletions out/web/hello.html

This file was deleted.

Loading

0 comments on commit 570922b

Please sign in to comment.