Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
df55a95
Replace CMAKE_SOURCE_DIR with PROJECT_SOURCE_DIR
sparist Nov 15, 2022
a85de74
Merge branch 'main' into dcp/develop
sparist Nov 18, 2022
2f1c307
Merge branch 'main' into dcp/develop
sparist Nov 22, 2022
1b300bf
Vector::Clear: disable "maybe initialized" warning
sparist Nov 22, 2022
7c84933
Remove unknown no-documentation-unknown-command
sparist Nov 22, 2022
a534a9e
Merge branch 'dcp/develop' of github.com:Kings-Distributed-Systems/da…
sparist Nov 22, 2022
3f4c2ce
Revert "Remove unknown no-documentation-unknown-command"
sparist Nov 22, 2022
0be9026
Merge branch 'chromium/5454' into dcp/develop
sparist Dec 2, 2022
6ea8860
.gitignore: add .gclient_previous_custom_vars
sparist Dec 5, 2022
3caf2ee
Fix unused-but-set-parameter warning
sparist Dec 5, 2022
d902193
Merge remote-tracking branch 'upstream/chromium/5464' into dcp/develop
sparist Dec 9, 2022
606b08b
Fix -Werror=unused-but-set-variable
sparist Dec 12, 2022
d33e860
Fix NAPI_SYMBOL name substitution in message
sparist Jan 10, 2023
ff440e3
Export Initialize function
sparist Jan 27, 2023
19fbe22
dawn_node: set archive output directory
sparist Jan 27, 2023
7e09ba7
Temporarily disable weak Node-API symbols
sparist Feb 3, 2023
eb569c7
Re-enable NAPI_SYMBOL on Clang
sparist Feb 3, 2023
860d17d
Windows: make NAPI library name configurable
sparist Feb 12, 2023
385809b
Disable psabi
sparist Mar 2, 2023
9100a1c
Restore NAPI_SYMBOL on all non-Windows platforms
sparist Jul 25, 2023
abb2727
Revert "Restore NAPI_SYMBOL on all non-Windows platforms"
sparist Jul 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ function(common_compile_options TARGET)
target_compile_options(${TARGET} PRIVATE
-fno-exceptions
-fno-rtti
-Wno-psabi
)

if (${DAWN_ENABLE_MSAN})
Expand Down
7 changes: 6 additions & 1 deletion src/dawn/node/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ set_target_properties(dawn_node PROPERTIES
PREFIX ""
OUTPUT_NAME "dawn"
SUFFIX ".node"
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
CXX_STANDARD 17
Expand All @@ -92,12 +93,16 @@ file(READ "${NODE_API_HEADERS_DIR}/symbols.js" NAPI_SYMBOLS_JS_CONTENT)
string(REGEX MATCHALL "napi_[a-z0-9_]*" NAPI_SYMBOLS "${NAPI_SYMBOLS_JS_CONTENT}")

if (WIN32)
set(NODE_API_BINARY_FILE "node.exe" CACHE STRING
"The name of the file in which to find the Node-API symbols."
)

# Generate the NapiSymbols.def file from the Napi symbol list
set(NAPI_SYMBOLS_DEF "${DAWN_NODE_GEN_DIR}/NapiSymbols.def")
list(TRANSFORM NAPI_SYMBOLS PREPEND " ")
list(TRANSFORM NAPI_SYMBOLS APPEND "\n")
string(REPLACE ";" "" NAPI_SYMBOLS "${NAPI_SYMBOLS}")
string(PREPEND NAPI_SYMBOLS "LIBRARY node.exe\nEXPORTS\n")
string(PREPEND NAPI_SYMBOLS "LIBRARY ${NODE_API_BINARY_FILE}\nEXPORTS\n")
file(GENERATE OUTPUT "${NAPI_SYMBOLS_DEF}" CONTENT "${NAPI_SYMBOLS}")
# Generate the NapiSymbols.lib from the NapiSymbols.def file
set(NAPI_SYMBOLS_LIB "${DAWN_NODE_GEN_DIR}/NapiSymbols.lib")
Expand Down
2 changes: 1 addition & 1 deletion src/dawn/node/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Napi::Value CreateGPU(const Napi::CallbackInfo& info) {
// Initialize() initializes the Dawn node module, registering all the WebGPU
// types into the global object, and adding the 'create' function on the exported
// object.
Napi::Object Initialize(Napi::Env env, Napi::Object exports) {
NAPI_MODULE_EXPORT Napi::Object Initialize(Napi::Env env, Napi::Object exports) {
// Initialize Tint
tint::Initialize();

Expand Down
6 changes: 5 additions & 1 deletion src/dawn/node/NapiSymbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@
#error "NapiSymbols.cpp is not used on Windows"
#endif

#ifdef __clang__
#define NAPI_SYMBOL(NAME) \
__attribute__((weak)) void NAME() { \
UNREACHABLE( \
"#NAME is a weak stub, and should have been runtime replaced by the node " \
#NAME " is a weak stub, and should have been runtime replaced by the node "\
"implementation"); \
}
#else
#define NAPI_SYMBOL(NAME)
#endif

extern "C" {
// List of Napi symbols generated from the node_api_headers/symbols.js file
Expand Down
2 changes: 1 addition & 1 deletion src/tint/resolver/const_eval.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ ConstEval::Result ConstEval::OpShiftRight(const sem::Type* ty,
const UT e1u = static_cast<UT>(e1);
const UT e2u = static_cast<UT>(e2);

auto signed_shift_right = [&] {
[[maybe_unused]] auto signed_shift_right = [&] {
// In C++, right shift of a signed negative number is implementation-defined.
// Although most implementations sign-extend, we do it manually to ensure it works
// correctly on all implementations.
Expand Down