2023-05-05 12:53:00 +02:00
|
|
|
diff --git base/test/BUILD.gn base/test/BUILD.gn
|
2023-08-09 23:17:17 +02:00
|
|
|
index e89151a223001..d268f2efcfab4 100644
|
2023-05-05 12:53:00 +02:00
|
|
|
--- base/test/BUILD.gn
|
|
|
|
+++ base/test/BUILD.gn
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -181,11 +181,6 @@ static_library("test_support") {
|
2023-06-26 12:13:38 +02:00
|
|
|
|
|
|
|
if (enable_base_tracing) {
|
|
|
|
public_deps += [ "//third_party/perfetto:perfetto_test_support" ]
|
|
|
|
- public_deps += [ ":test_trace_processor" ]
|
|
|
|
- sources += [
|
|
|
|
- "test_trace_processor.cc",
|
|
|
|
- "test_trace_processor.h",
|
|
|
|
- ]
|
|
|
|
if (is_ios) {
|
|
|
|
deps += [
|
|
|
|
":test_trace_processor+bundle",
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -524,7 +519,7 @@ if (enable_base_tracing) {
|
2023-05-05 12:53:00 +02:00
|
|
|
# processor depends on dev_sqlite. The two share the same symbols but have
|
|
|
|
# different implementations, so we need to hide dev_sqlite in this shared
|
|
|
|
# library even in non-component builds to prevent duplicate symbols.
|
|
|
|
- _target_type = "shared_library"
|
|
|
|
+ _target_type = "component"
|
|
|
|
if (is_ios) {
|
|
|
|
_target_type = "ios_framework_bundle"
|
|
|
|
}
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -533,6 +528,8 @@ if (enable_base_tracing) {
|
2023-05-30 10:55:32 +02:00
|
|
|
defines = [ "TEST_TRACE_PROCESSOR_IMPL" ]
|
|
|
|
testonly = true
|
|
|
|
sources = [
|
|
|
|
+ "test_trace_processor.cc",
|
|
|
|
+ "test_trace_processor.h",
|
|
|
|
"test_trace_processor_export.h",
|
|
|
|
"test_trace_processor_impl.cc",
|
|
|
|
"test_trace_processor_impl.h",
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -550,33 +547,6 @@ if (enable_base_tracing) {
|
2023-05-05 12:53:00 +02:00
|
|
|
output_name = "TestTraceProcessor"
|
|
|
|
bundle_deps_filter = [ "//third_party/icu:icudata" ]
|
|
|
|
}
|
|
|
|
-
|
|
|
|
- # Set rpath on dependent tests so that they can find the shared library
|
|
|
|
- # in a non-component build.
|
|
|
|
- if (!is_component_build) {
|
|
|
|
- all_dependent_configs = []
|
|
|
|
- if (is_linux || is_chromeos) {
|
|
|
|
- all_dependent_configs +=
|
|
|
|
- [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
|
|
|
|
- }
|
|
|
|
- if (is_mac) {
|
|
|
|
- # We need the lib to be in $root_out_dir/Libraries so the library is where
|
|
|
|
- # the linker expects it, since we set the install_name flag. We need to
|
|
|
|
- # set this flag so that the library can be found when it is bundled in the
|
|
|
|
- # Content Shell Framework (see test_trace_processor_bundle_data).
|
|
|
|
- output_dir = "$root_out_dir/Libraries"
|
|
|
|
- ldflags = [ "-Wl,-install_name,@loader_path/Libraries/libtest_trace_processor.dylib" ]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!is_component_build && is_mac) {
|
|
|
|
- bundle_data("test_trace_processor_bundle_data") {
|
|
|
|
- testonly = true
|
|
|
|
- sources = [ "$root_out_dir/Libraries/libtest_trace_processor.dylib" ]
|
|
|
|
- outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
|
|
|
|
- public_deps = [ ":test_trace_processor" ]
|
|
|
|
- }
|
|
|
|
}
|
2023-05-30 10:55:32 +02:00
|
|
|
} else if (!is_component_build && is_mac) {
|
|
|
|
# Provide a dummy target in order for clients to not have to special-case
|
2023-05-05 12:53:00 +02:00
|
|
|
diff --git base/test/test_trace_processor_export.h base/test/test_trace_processor_export.h
|
|
|
|
index f5191b804bc07..aadb7d66ba4c3 100644
|
|
|
|
--- base/test/test_trace_processor_export.h
|
|
|
|
+++ base/test/test_trace_processor_export.h
|
|
|
|
@@ -5,6 +5,7 @@
|
|
|
|
#ifndef BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_
|
|
|
|
#define BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_
|
|
|
|
|
|
|
|
+#if defined(COMPONENT_BUILD)
|
|
|
|
#if defined(WIN32)
|
|
|
|
|
|
|
|
#if defined(TEST_TRACE_PROCESSOR_IMPL)
|
|
|
|
@@ -23,4 +24,8 @@
|
|
|
|
|
|
|
|
#endif // defined(WIN32)
|
|
|
|
|
|
|
|
+#else // defined(COMPONENT_BUILD)
|
|
|
|
+#define TEST_TRACE_PROCESSOR_EXPORT
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#endif // BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_
|
|
|
|
diff --git content/shell/BUILD.gn content/shell/BUILD.gn
|
2023-08-09 23:17:17 +02:00
|
|
|
index 903bbb1a8b5ab..d8169dafa81c4 100644
|
2023-05-05 12:53:00 +02:00
|
|
|
--- content/shell/BUILD.gn
|
|
|
|
+++ content/shell/BUILD.gn
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -838,7 +838,6 @@ if (is_mac) {
|
2023-05-05 12:53:00 +02:00
|
|
|
# Specify a sensible install_name for static builds. The library is
|
|
|
|
# dlopen()ed so this is not used to resolve the module.
|
|
|
|
ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name" ]
|
|
|
|
- deps += [ "//base/test:test_trace_processor_bundle_data" ]
|
|
|
|
} else {
|
|
|
|
# Both the main :content_shell and :content_shell_helper_app executables
|
|
|
|
# need to link the framework. Because they are at different directory
|