From dd1df9c7d81f3085153e24867da3410c541f845b Mon Sep 17 00:00:00 2001 From: brettw Date: Fri, 10 Jul 2015 17:20:51 -0700 Subject: [PATCH] Move GN obj files to target-specific dirs Previously GN would put object files in a similar place to GYP. They would go in a corresponding directory as the source file and would be prefixed with the target name for uniqueness. Since GN target names are not unique, this doesn't work as well. Instead use a simpler scheme and put all the object files in a directory for each target. This causes a few object file name collisions which this patch fixes in various ways: - Renamed chrome/browser/ui/views/find_bar_host_interactive_uitest.cc to have "views" in the name (collided with chrome/browser/ui/find_bar/find_bar_host_interactive_uitest.cc) - Renamed chrome/browser/apps/speech_recognition_browsertest.cc to have "app" in the name (collided with chrome/browser/speech/speech_recognition_browsertest.cc). - Renamed chrome/common/extensions/api/extension_api_unittest.cc to have "common" in the name (collided with chrome/browser/extensions/extension_api_unittest.cc which is actually a test harness with that name). - Moved the extensions files that were in the chrome interactive UI tests and browser tests to source sets in the extensions directory. These are things that should be cleaned up and moved there anyway. - Net has some messy duplication in quic files. I made a dummy target for them. Apparently each copy of this file (same code, different namespace) is supposed to match something different upstream and this should be fixed. - Moved chrome/browser/chromeos unit tests to its own target. - Renamed chrome/browser/favicon/favicon_helper to favicon_utils. It conflicted with chrome/browser/android/favicon_helper which has an actual class named "FaviconHelper. - Renamed service.* and service_factory.* in chrome/browser/chromeos/launcher_search_provider to have a launcher_search_provider prefix to avoid collisions with the file_system_provider one. - Added a "chromeos" prefix to chrome/browser/chromeos/first_run/first_run_browsertest.cc to avoid collisions with the one in browser/first_run. - Added "chromeos" to chrome/browser/chromeos/preferences_browsertest.cc to avoid collision with browser/ui/webui/options. - Rename "chrome/browser/chromeos/drive/test_util.*" to "drive_test_util.*". Update includes. Rename chrome/browser/chromeos/file_manager/drive_test_util* to mount_test_util to avoid colliding with above new file. The deps->public_deps changes in components/policy and content/test is because those targets were used externally in a way that this patch uncovered. Review URL: https://codereview.chromium.org/1208963003 Cr-Original-Commit-Position: refs/heads/master@{#338408} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 39355da5ab86e662d701fcba8fef4e20921b38f0 --- toolchain/gcc_toolchain.gni | 6 +++--- toolchain/mac/BUILD.gn | 10 +++++----- toolchain/win/BUILD.gn | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/toolchain/gcc_toolchain.gni b/toolchain/gcc_toolchain.gni index ae9599a46..31c505c40 100644 --- a/toolchain/gcc_toolchain.gni +++ b/toolchain/gcc_toolchain.gni @@ -95,7 +95,7 @@ template("gcc_toolchain") { depsformat = "gcc" description = "CC {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", ] } @@ -105,7 +105,7 @@ template("gcc_toolchain") { depsformat = "gcc" description = "CXX {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", ] } @@ -116,7 +116,7 @@ template("gcc_toolchain") { depsformat = "gcc" description = "ASM {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", ] } diff --git a/toolchain/mac/BUILD.gn b/toolchain/mac/BUILD.gn index da4ca0532..d16bb23b7 100644 --- a/toolchain/mac/BUILD.gn +++ b/toolchain/mac/BUILD.gn @@ -54,7 +54,7 @@ template("mac_toolchain") { depsformat = "gcc" description = "CC {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", ] } @@ -64,7 +64,7 @@ template("mac_toolchain") { depsformat = "gcc" description = "CXX {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", ] } @@ -75,7 +75,7 @@ template("mac_toolchain") { depsformat = "gcc" description = "ASM {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", ] } @@ -85,7 +85,7 @@ template("mac_toolchain") { depsformat = "gcc" description = "OBJC {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", ] } @@ -95,7 +95,7 @@ template("mac_toolchain") { depsformat = "gcc" description = "OBJCXX {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", ] } diff --git a/toolchain/win/BUILD.gn b/toolchain/win/BUILD.gn index 0236c8e6c..454cddea4 100644 --- a/toolchain/win/BUILD.gn +++ b/toolchain/win/BUILD.gn @@ -88,7 +88,7 @@ template("msvc_toolchain") { depsformat = "msvc" description = "CC {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.obj", ] rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" } @@ -105,7 +105,7 @@ template("msvc_toolchain") { depsformat = "msvc" description = "CXX {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.obj", ] rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}" } @@ -113,7 +113,7 @@ template("msvc_toolchain") { tool("rc") { command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{include_dirs}} /fo{{output}} {{source}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.res", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.res", ] description = "RC {{output}}" } @@ -124,7 +124,7 @@ template("msvc_toolchain") { command = "$python_path gyp-win-tool asm-wrapper $env ml.exe {{defines}} {{include_dirs}} /safeseh /c /Fo {{output}} {{source}}" description = "ASM {{output}}" outputs = [ - "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.obj", ] }