mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
Add static library versions of libdawn*
Chromium will want to have both static and shared library versions of Dawn to use in non-component and component builds respectively. The *_export.h files are modified to noop when *_SHARED_LIBRARY is not defined so that the static library doesn't export symbols that aren't imported in dependents (this would break compilation on Windows). A dawn_library_combo is introduced in BUILD.gn that factors out all the logic needed to produce shared libraries and handle the _EXPORT macros. Also contains a fix to dawncpp to export only the methods that aren't defined in the header (otherwise they get defined multiple times) BUG=dawn:85 Change-Id: Ib747deb9308e1165dd66002487147ba279d3eac0 Reviewed-on: https://dawn-review.googlesource.com/c/3761 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
97d2a71684
commit
bd48385d50
@@ -130,9 +130,9 @@ namespace dawn {
|
||||
{% macro render_cpp_method_declaration(type, method) %}
|
||||
{% set CppType = as_cppType(type.name) %}
|
||||
{% if method.return_type.name.concatcase() == "void" and type.is_builder -%}
|
||||
{{CppType}} const&
|
||||
DAWN_EXPORT {{CppType}} const&
|
||||
{%- else -%}
|
||||
{{as_cppType(method.return_type.name)}}
|
||||
DAWN_EXPORT {{as_cppType(method.return_type.name)}}
|
||||
{%- endif -%}
|
||||
{{" "}}{{method.name.CamelCase()}}(
|
||||
{%- for arg in method.arguments -%}
|
||||
@@ -149,7 +149,7 @@ namespace dawn {
|
||||
{% for type in by_category["object"] %}
|
||||
{% set CppType = as_cppType(type.name) %}
|
||||
{% set CType = as_cType(type.name) %}
|
||||
class DAWN_EXPORT {{CppType}} : public ObjectBase<{{CppType}}, {{CType}}> {
|
||||
class {{CppType}} : public ObjectBase<{{CppType}}, {{CType}}> {
|
||||
public:
|
||||
using ObjectBase::ObjectBase;
|
||||
using ObjectBase::operator=;
|
||||
@@ -160,8 +160,8 @@ namespace dawn {
|
||||
|
||||
private:
|
||||
friend ObjectBase<{{CppType}}, {{CType}}>;
|
||||
static void DawnReference({{CType}} handle);
|
||||
static void DawnRelease({{CType}} handle);
|
||||
static DAWN_EXPORT void DawnReference({{CType}} handle);
|
||||
static DAWN_EXPORT void DawnRelease({{CType}} handle);
|
||||
};
|
||||
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user