dawn/node: Define NAPI_DISABLE_CPP_EXCEPTIONS

Wrap `napi.h` with a Dawn header that defines `NAPI_DISABLE_CPP_EXCEPTIONS`, and then includes the napi.h header.

Required now that CMake correctly disables exceptions with `-fno-exceptions`.

Change-Id: If31b28d331f2071a0119339c60cc3ab8ab801a98
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86301
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-04-11 20:10:10 +00:00 committed by Dawn LUCI CQ
parent 262a4c4824
commit 3f4b260264
27 changed files with 74 additions and 27 deletions

View File

@ -19,7 +19,8 @@
#include <memory>
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
namespace wgpu::binding {

View File

@ -20,8 +20,9 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/binding/Errors.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -15,7 +15,7 @@
#ifndef SRC_DAWN_NODE_BINDING_ERRORS_H_
#define SRC_DAWN_NODE_BINDING_ERRORS_H_
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
namespace wgpu::binding {

View File

@ -17,8 +17,9 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/binding/Flags.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,8 +17,9 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/binding/AsyncRunner.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -16,8 +16,9 @@
#define SRC_DAWN_NODE_BINDING_GPUDEVICE_H_
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/binding/AsyncRunner.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,8 +17,9 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/binding/AsyncRunner.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,8 +17,9 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/binding/AsyncRunner.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -17,7 +17,8 @@
#include "dawn/native/DawnNative.h"
#include "dawn/webgpu_cpp.h"
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/interop/WebGPU.h"
namespace wgpu::binding {

View File

@ -26,7 +26,7 @@
#include <variant>
#include <vector>
#include "node-addon-api/napi.h"
#include "src/dawn/node/interop/Napi.h"
#include "src/dawn/node/utils/Debug.h"
@ -119,7 +119,7 @@ namespace wgpu::interop {
// stringified values append to the error message.
// If Result is a success, then a success Result is returned.
template <typename... VALUES>
Result Append(VALUES && ... values) {
Result Append(VALUES&&... values) {
if (*this) {
return *this;
}

View File

@ -0,0 +1,23 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_DAWN_NODE_INTEROP_NAPI_H_
#define SRC_DAWN_NODE_INTEROP_NAPI_H_
// Dawn is built with exceptions disabled.
#define NAPI_DISABLE_CPP_EXCEPTIONS
#include "node-addon-api/napi.h"
#endif // SRC_DAWN_NODE_INTEROP_NAPI_H_