diff --git base/test/BUILD.gn base/test/BUILD.gn index c37ba6534270c..e1a9443a746cd 100644 --- base/test/BUILD.gn +++ base/test/BUILD.gn @@ -199,11 +199,6 @@ static_library("test_support") { 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", - ] deps += [ ":amalgamated_perfetto_sql_stdlib", ":gen_cc_chrome_track_event_descriptor", @@ -597,7 +592,7 @@ if (enable_base_tracing) { # 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" } @@ -606,6 +601,8 @@ if (enable_base_tracing) { 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", @@ -623,33 +620,6 @@ if (enable_base_tracing) { 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" ] - } } } else if (!is_component_build && is_mac) { # Provide a dummy target in order for clients to not have to special-case 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 index 7adc7cdd12c30..0e93b2dfe2f25 100644 --- content/shell/BUILD.gn +++ content/shell/BUILD.gn @@ -913,7 +913,6 @@ if (is_mac) { # 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