aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorYuri Wiitala <miu@chromium.org>2019-11-20 11:20:54 -0800
committerCommit Bot <commit-bot@chromium.org>2019-11-20 19:29:19 +0000
commit8e6db3b055baf1fd37ffb4805a363a9e78cb886e (patch)
treecb2c5141fac64566b1267c240599506d972b562e /build
parentcbf8daad50ce2889c58f488b9b4d1702118caebc (diff)
downloadopenscreen-8e6db3b055baf1fd37ffb4805a363a9e78cb886e.tar.gz
Move platform/api/trace_logging.h → util/trace_logging.h, etc...
This change moves the parts of trace logging that are library code (and not platform specific) into util or platform/base, as appropriate. Library code using the tracing macros is pointed to util/trace_logging.h. Overall, this "minifies" the platform/api an embedder must implement to just the TraceLoggerPlatform interface. Removed "enable flag" from build config, and started a new features.h config. Will revisit this mechanism in a future change (and consolidate other feature flags). Fixed issues related to enabling the feature (bots were not verifying anything because it had been left off). Fixed a few C++ style issues found in code as it was moved around. This change also fixes unit test crashing due to dangling pointers to detsroyed MockLoggingPlatforms being left around (the global pointer was not being nulled-out after the tracing unit tests were executed). To simplify, the ctor/dtor now automatically set/clear the global pointer. The crashing seems not to have been discovered because the BUILD.gn arg "enable_trace_logging" defaults to false and so our bots were not testing things. Will revisit this in a later change... Bug: openscreen:77 Change-Id: I638a3998af0a3aacf4d8b8e0f059b331582313cb Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1920299 Commit-Queue: Yuri Wiitala <miu@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org>
Diffstat (limited to 'build')
-rw-r--r--build/config/BUILD.gn6
-rw-r--r--build/config/features.h13
2 files changed, 13 insertions, 6 deletions
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
index b6d48531..67e37634 100644
--- a/build/config/BUILD.gn
+++ b/build/config/BUILD.gn
@@ -11,9 +11,6 @@ declare_args() {
# Enable thread sanitizer.
is_tsan = false
-
- # Enable trace logging.
- enable_trace_logging = false
}
config("compiler_defaults") {
@@ -122,9 +119,6 @@ config("openscreen_code") {
if (dcheck_always_on) {
defines += [ "DCHECK_ALWAYS_ON" ]
}
- if (enable_trace_logging) {
- defines += [ "ENABLE_TRACE_LOGGING" ]
- }
}
config("default_optimization") {
diff --git a/build/config/features.h b/build/config/features.h
new file mode 100644
index 00000000..d0617bdf
--- /dev/null
+++ b/build/config/features.h
@@ -0,0 +1,13 @@
+// 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.
+
+#ifndef BUILD_CONFIG_FEATURES_H_
+#define BUILD_CONFIG_FEATURES_H_
+
+// TODO(miu): This header should be auto-generated from GN args. This will be
+// revisited in a soon-upcoming change.
+
+#define ENABLE_TRACE_LOGGING
+
+#endif // BUILD_CONFIG_FEATURES_H_