From b256df05344dd0593079d72ad0174f218c4592f8 Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Sun, 8 Mar 2015 16:25:34 -0400 Subject: [PATCH] Set target_name on many targets to use a crashpad_ prefix. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Chromium, many targets are built, sharing a single output directory. Collisions are likely. When integrating Crashpad into Chromium, the ui/snapshot library and Crashpad’s snapshot library were found to conflict. This change gives most Crashpad targets a “crashpad_” prefix to avoid conflicts. All library and test targets are given a target_name with this prefix. Existing tools are not likely to conflict with anything else and are not given a prefix. BUG=crashpad:12 R=rsesek@chromium.org, scottmg@chromium.org Review URL: https://codereview.chromium.org/990553003 --- build/run_tests.py | 8 +++---- client/client.gyp | 16 +++++++------- compat/compat.gyp | 2 +- handler/handler.gyp | 12 +++++------ minidump/minidump.gyp | 16 +++++++------- snapshot/snapshot.gyp | 28 ++++++++++++------------ tools/tools.gyp | 36 +++++++++++++++---------------- util/test/executable_path_test.cc | 5 +++-- util/util.gyp | 24 ++++++++++----------- util/win/process_info_test.cc | 5 +++-- 10 files changed, 77 insertions(+), 75 deletions(-) diff --git a/build/run_tests.py b/build/run_tests.py index 324844cb..bec22cfc 100755 --- a/build/run_tests.py +++ b/build/run_tests.py @@ -35,10 +35,10 @@ def main(args): binary_dir = os.path.join('out', args[0]) tests = [ - 'client_test', - 'minidump_test', - 'snapshot_test', - 'util_test', + 'crashpad_client_test', + 'crashpad_minidump_test', + 'crashpad_snapshot_test', + 'crashpad_util_test', ] for test in tests: print '-' * 80 diff --git a/client/client.gyp b/client/client.gyp index 9036fef6..99f66d1c 100644 --- a/client/client.gyp +++ b/client/client.gyp @@ -18,12 +18,12 @@ ], 'targets': [ { - 'target_name': 'client', + 'target_name': 'crashpad_client', 'type': 'static_library', 'dependencies': [ - '../compat/compat.gyp:compat', + '../compat/compat.gyp:crashpad_compat', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../util/util.gyp:util', + '../util/util.gyp:crashpad_util', ], 'include_dirs': [ '..', @@ -56,16 +56,16 @@ ], }, { - 'target_name': 'client_test', + 'target_name': 'crashpad_client_test', 'type': 'executable', 'dependencies': [ - 'client', - '../compat/compat.gyp:compat', + 'crashpad_client', + '../compat/compat.gyp:crashpad_compat', '../third_party/gtest/gtest.gyp:gtest', '../third_party/gtest/gtest.gyp:gtest_main', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../util/util.gyp:util', - '../util/util.gyp:util_test_lib', + '../util/util.gyp:crashpad_util', + '../util/util.gyp:crashpad_util_test_lib', ], 'include_dirs': [ '..', diff --git a/compat/compat.gyp b/compat/compat.gyp index eb382b37..84b029fc 100644 --- a/compat/compat.gyp +++ b/compat/compat.gyp @@ -18,7 +18,7 @@ ], 'targets': [ { - 'target_name': 'compat', + 'target_name': 'crashpad_compat', 'type': 'static_library', 'sources': [ 'mac/AvailabilityMacros.h', diff --git a/handler/handler.gyp b/handler/handler.gyp index c062075e..fe5384d7 100644 --- a/handler/handler.gyp +++ b/handler/handler.gyp @@ -23,13 +23,13 @@ 'target_name': 'crashpad_handler', 'type': 'executable', 'dependencies': [ - '../client/client.gyp:client', - '../compat/compat.gyp:compat', - '../minidump/minidump.gyp:minidump', - '../snapshot/snapshot.gyp:snapshot', + '../client/client.gyp:crashpad_client', + '../compat/compat.gyp:crashpad_compat', + '../minidump/minidump.gyp:crashpad_minidump', + '../snapshot/snapshot.gyp:crashpad_snapshot', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../tools/tools.gyp:tool_support', - '../util/util.gyp:util', + '../tools/tools.gyp:crashpad_tool_support', + '../util/util.gyp:crashpad_util', ], 'include_dirs': [ '..', diff --git a/minidump/minidump.gyp b/minidump/minidump.gyp index e92d70a0..a8ead831 100644 --- a/minidump/minidump.gyp +++ b/minidump/minidump.gyp @@ -18,16 +18,16 @@ ], 'targets': [ { - 'target_name': 'minidump', + 'target_name': 'crashpad_minidump', 'type': 'static_library', 'dependencies': [ - '../compat/compat.gyp:compat', - '../snapshot/snapshot.gyp:snapshot', + '../compat/compat.gyp:crashpad_compat', + '../snapshot/snapshot.gyp:crashpad_snapshot', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../util/util.gyp:util', + '../util/util.gyp:crashpad_util', ], 'export_dependent_settings': [ - '../compat/compat.gyp:compat', + '../compat/compat.gyp:crashpad_compat', ], 'include_dirs': [ '..', @@ -73,11 +73,11 @@ ], }, { - 'target_name': 'minidump_test', + 'target_name': 'crashpad_minidump_test', 'type': 'executable', 'dependencies': [ - 'minidump', - '../snapshot/snapshot.gyp:snapshot_test_lib', + 'crashpad_minidump', + '../snapshot/snapshot.gyp:crashpad_snapshot_test_lib', '../third_party/gtest/gtest.gyp:gtest', '../third_party/gtest/gtest.gyp:gtest_main', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', diff --git a/snapshot/snapshot.gyp b/snapshot/snapshot.gyp index c9d0da70..387d4687 100644 --- a/snapshot/snapshot.gyp +++ b/snapshot/snapshot.gyp @@ -18,13 +18,13 @@ ], 'targets': [ { - 'target_name': 'snapshot', + 'target_name': 'crashpad_snapshot', 'type': 'static_library', 'dependencies': [ - '../client/client.gyp:client', - '../compat/compat.gyp:compat', + '../client/client.gyp:crashpad_client', + '../compat/compat.gyp:crashpad_compat', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../util/util.gyp:util', + '../util/util.gyp:crashpad_util', ], 'include_dirs': [ '..', @@ -102,13 +102,13 @@ ] }, { - 'target_name': 'snapshot_test_lib', + 'target_name': 'crashpad_snapshot_test_lib', 'type': 'static_library', 'dependencies': [ - 'snapshot', - '../compat/compat.gyp:compat', + 'crashpad_snapshot', + '../compat/compat.gyp:crashpad_compat', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../util/util.gyp:util', + '../util/util.gyp:crashpad_util', ], 'include_dirs': [ '..', @@ -131,17 +131,17 @@ ], }, { - 'target_name': 'snapshot_test', + 'target_name': 'crashpad_snapshot_test', 'type': 'executable', 'dependencies': [ - 'snapshot', - '../client/client.gyp:client', - '../compat/compat.gyp:compat', + 'crashpad_snapshot', + '../client/client.gyp:crashpad_client', + '../compat/compat.gyp:crashpad_compat', '../third_party/gtest/gtest.gyp:gtest', '../third_party/gtest/gtest.gyp:gtest_main', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../util/util.gyp:util', - '../util/util.gyp:util_test_lib', + '../util/util.gyp:crashpad_util', + '../util/util.gyp:crashpad_util_test_lib', ], 'include_dirs': [ '..', diff --git a/tools/tools.gyp b/tools/tools.gyp index bf239fa6..b0981f5f 100644 --- a/tools/tools.gyp +++ b/tools/tools.gyp @@ -47,7 +47,7 @@ 'targets': [ { - 'target_name': 'tool_support', + 'target_name': 'crashpad_tool_support', 'type': 'static_library', 'dependencies': [ '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', @@ -64,10 +64,10 @@ 'target_name': 'catch_exception_tool', 'type': 'executable', 'dependencies': [ - 'tool_support', - '../compat/compat.gyp:compat', + 'crashpad_tool_support', + '../compat/compat.gyp:crashpad_compat', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../util/util.gyp:util', + '../util/util.gyp:crashpad_util', ], 'include_dirs': [ '..', @@ -80,10 +80,10 @@ 'target_name': 'exception_port_tool', 'type': 'executable', 'dependencies': [ - 'tool_support', - '../compat/compat.gyp:compat', + 'crashpad_tool_support', + '../compat/compat.gyp:crashpad_compat', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../util/util.gyp:util', + '../util/util.gyp:crashpad_util', ], 'include_dirs': [ '..', @@ -104,12 +104,12 @@ 'target_name': 'generate_dump', 'type': 'executable', 'dependencies': [ - 'tool_support', - '../compat/compat.gyp:compat', - '../minidump/minidump.gyp:minidump', - '../snapshot/snapshot.gyp:snapshot', + 'crashpad_tool_support', + '../compat/compat.gyp:crashpad_compat', + '../minidump/minidump.gyp:crashpad_minidump', + '../snapshot/snapshot.gyp:crashpad_snapshot', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../util/util.gyp:util', + '../util/util.gyp:crashpad_util', ], 'include_dirs': [ '..', @@ -130,10 +130,10 @@ 'target_name': 'on_demand_service_tool', 'type': 'executable', 'dependencies': [ - 'tool_support', - '../compat/compat.gyp:compat', + 'crashpad_tool_support', + '../compat/compat.gyp:crashpad_compat', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - '../util/util.gyp:util', + '../util/util.gyp:crashpad_util', ], 'include_dirs': [ '..', @@ -152,9 +152,9 @@ 'target_name': 'run_with_crashpad', 'type': 'executable', 'dependencies': [ - 'tool_support', - '../client/client.gyp:client', - '../compat/compat.gyp:compat', + 'crashpad_tool_support', + '../client/client.gyp:crashpad_client', + '../compat/compat.gyp:crashpad_compat', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', ], 'include_dirs': [ diff --git a/util/test/executable_path_test.cc b/util/test/executable_path_test.cc index 54374e34..5c18c45b 100644 --- a/util/test/executable_path_test.cc +++ b/util/test/executable_path_test.cc @@ -26,9 +26,10 @@ TEST(ExecutablePath, ExecutablePath) { base::FilePath executable_path = ExecutablePath(); base::FilePath executable_name = executable_path.BaseName(); #if defined(OS_WIN) - EXPECT_EQ(FILE_PATH_LITERAL("util_test.exe"), executable_name.value()); + EXPECT_EQ(FILE_PATH_LITERAL("crashpad_util_test.exe"), + executable_name.value()); #else - EXPECT_EQ("util_test", executable_name.value()); + EXPECT_EQ("crashpad_util_test", executable_name.value()); #endif // OS_WIN } diff --git a/util/util.gyp b/util/util.gyp index 31368ee1..ac7fc477 100644 --- a/util/util.gyp +++ b/util/util.gyp @@ -18,10 +18,10 @@ ], 'targets': [ { - 'target_name': 'util', + 'target_name': 'crashpad_util', 'type': 'static_library', 'dependencies': [ - '../compat/compat.gyp:compat', + '../compat/compat.gyp:crashpad_compat', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', ], 'include_dirs': [ @@ -210,13 +210,13 @@ ], }, { - 'target_name': 'util_test_lib', + 'target_name': 'crashpad_util_test_lib', 'type': 'static_library', 'dependencies': [ - '../compat/compat.gyp:compat', + '../compat/compat.gyp:crashpad_compat', '../third_party/gtest/gtest.gyp:gtest', '../third_party/mini_chromium/mini_chromium/base/base.gyp:base', - 'util', + 'crashpad_util', ], 'include_dirs': [ '..', @@ -253,13 +253,13 @@ ], }, { - 'target_name': 'util_test', + 'target_name': 'crashpad_util_test', 'type': 'executable', 'dependencies': [ - 'util', - 'util_test_lib', - 'util_test_multiprocess_exec_test_child', - '../compat/compat.gyp:compat', + 'crashpad_util', + 'crashpad_util_test_lib', + 'crashpad_util_test_multiprocess_exec_test_child', + '../compat/compat.gyp:crashpad_compat', '../third_party/gmock/gmock.gyp:gmock', '../third_party/gtest/gtest.gyp:gtest', '../third_party/gtest/gtest.gyp:gtest_main', @@ -334,7 +334,7 @@ ], }, { - 'target_name': 'util_test_multiprocess_exec_test_child', + 'target_name': 'crashpad_util_test_multiprocess_exec_test_child', 'type': 'executable', 'sources': [ 'test/multiprocess_exec_test_child.cc', @@ -345,7 +345,7 @@ ['OS=="win"', { 'targets': [ { - 'target_name': 'util_test_process_info_test_child', + 'target_name': 'crashpad_util_test_process_info_test_child', 'type': 'executable', 'sources': [ 'win/process_info_test_child.cc', diff --git a/util/win/process_info_test.cc b/util/win/process_info_test.cc index 386bd2f5..52f9fdd9 100644 --- a/util/win/process_info_test.cc +++ b/util/win/process_info_test.cc @@ -52,7 +52,7 @@ TEST(ProcessInfo, Self) { std::vector modules; EXPECT_TRUE(process_info.Modules(&modules)); ASSERT_GE(modules.size(), 2u); - const wchar_t kSelfName[] = L"\\util_test.exe"; + const wchar_t kSelfName[] = L"\\crashpad_util_test.exe"; ASSERT_GE(modules[0].size(), wcslen(kSelfName)); EXPECT_EQ(kSelfName, modules[0].substr(modules[0].size() - wcslen(kSelfName))); @@ -113,7 +113,8 @@ TEST(ProcessInfo, SomeOtherProcess) { std::vector modules; EXPECT_TRUE(process_info.Modules(&modules)); ASSERT_GE(modules.size(), 3u); - const wchar_t kChildName[] = L"\\util_test_process_info_test_child.exe"; + const wchar_t kChildName[] = + L"\\crashpad_util_test_process_info_test_child.exe"; ASSERT_GE(modules[0].size(), wcslen(kChildName)); EXPECT_EQ(kChildName, modules[0].substr(modules[0].size() - wcslen(kChildName)));