Add error directives for api.h/api_cpp.h #ifdef __EMSCRIPTEN__
This could avoid including dawn's version of webgpu headers and confusion at runtime when build with emscripten. Emscripten's system/include/webgpu headers should be used. Bug: None Change-Id: Ie8c6ebc23f28a56b1cb887ae7f11d3f738151aec Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79740 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
This commit is contained in:
parent
b626409c4b
commit
71a363bcf9
|
@ -24,6 +24,11 @@
|
|||
//*
|
||||
//*
|
||||
{% include 'BSD_LICENSE' %}
|
||||
{% if 'dawn' in enabled_tags %}
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#error "Do not include this header. Emscripten already provides headers needed for {{metadata.api}}."
|
||||
#endif
|
||||
{% endif %}
|
||||
#ifndef {{metadata.api.upper()}}_H_
|
||||
#define {{metadata.api.upper()}}_H_
|
||||
|
||||
|
|
|
@ -13,6 +13,11 @@
|
|||
//* limitations under the License.
|
||||
{% set API = metadata.api.upper() %}
|
||||
{% set api = API.lower() %}
|
||||
{% if 'dawn' not in enabled_tags %}
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#error "Do not include this header. Emscripten already provides headers needed for {{metadata.api}}."
|
||||
#endif
|
||||
{% endif %}
|
||||
#ifndef {{API}}_CPP_H_
|
||||
#define {{API}}_CPP_H_
|
||||
|
||||
|
|
Loading…
Reference in New Issue