diff --git base/test/BUILD.gn base/test/BUILD.gn index c6add87d77744..80d34d031e14b 100644 --- base/test/BUILD.gn +++ base/test/BUILD.gn @@ -185,11 +185,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 += [ ":gen_cc_chrome_track_event_descriptor" ] if (is_ios) { deps += [ @@ -534,7 +529,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" } @@ -543,6 +538,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", @@ -560,33 +557,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 f770bd917f92f..0607e2eedaaca 100644 --- content/shell/BUILD.gn +++ content/shell/BUILD.gn @@ -841,7 +841,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