From 824067c598022f08bcbd23ea9342497ae6360a67 Mon Sep 17 00:00:00 2001 From: Jordan Bayles Date: Tue, 23 Jul 2019 12:12:17 -0700 Subject: Fixup Chromium build Due to some recent changes, especially the new trace logging code, the Chromium build of Open Screen is broken. This patch fixes this. Change-Id: I4add685687707ef8e13403dbe54bf6f3ff9aef05 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1715248 Reviewed-by: Max Yakimakha Commit-Queue: Jordan Bayles --- tools/cddl/BUILD.gn | 6 ++++++ tools/cddl/stubs.cc | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 tools/cddl/stubs.cc (limited to 'tools') diff --git a/tools/cddl/BUILD.gn b/tools/cddl/BUILD.gn index f2c5d702..403cab3b 100644 --- a/tools/cddl/BUILD.gn +++ b/tools/cddl/BUILD.gn @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build_overrides/build.gni") + executable("cddl") { sources = [ "codegen.cc", @@ -15,6 +17,10 @@ executable("cddl") { "sema.h", ] + if (build_with_chromium) { + sources += [ "stubs.cc" ] + } + deps = [ # CDDL always uses the default logger, even when embedded. "../../platform", diff --git a/tools/cddl/stubs.cc b/tools/cddl/stubs.cc new file mode 100644 index 00000000..17585483 --- /dev/null +++ b/tools/cddl/stubs.cc @@ -0,0 +1,23 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// CDDL needs linked implementations of these methods when Open Screen is +// embedded, but can't link the embedder's implementation without explicit +// knowledge of it, due to the CDDL executable being linked and ran before +// the embedder's methods are compiled and linked. + +#include "platform/api/time.h" +#include "platform/api/trace_logging_platform.h" + +namespace openscreen { +namespace platform { +bool IsTraceLoggingEnabled(TraceCategory::Value category) { + return false; +} + +Clock::time_point Clock::now() noexcept { + return {}; +} +} // namespace platform +} // namespace openscreen \ No newline at end of file -- cgit v1.2.3