Skip to content

Commit

Permalink
Revert of Gets gn check to execute cleanly in mojo/common (patchset c…
Browse files Browse the repository at this point in the history
…hromium#4 id:60001 of https://codereview.chromium.org/1256593003/)

Reason for revert:
Caused failes on the windows gn bot: http://build.chromium.org/p/chromium.win/builders/Win8%20GN%20%28dbg%29/builds/10109/steps/compile/logs/stdio :
485/11287] CXX obj/ui/views/views/desktop_screen_win.obj
FAILED: E:/b/depot_tools/python276_bin/python.exe gyp-win-tool link-wrapper environment.x86 False link.exe /nologo /OUT:ipc_mojo_unittests.exe /PDB:ipc_mojo_unittests.exe.pdb @ipc_mojo_unittests.exe.rsp
mojo.dll.lib(mojo.dll) : error LNK2005: "public: __thiscall mojo::common::HandleWatcher::HandleWatcher(void)" (??0HandleWatcher@common@mojo@@QAE@XZ) already defined in handle_watcher.obj

mojo.dll.lib(mojo.dll) : error LNK2005: "public: __thiscall mojo::common::HandleWatcher::~HandleWatcher(void)" (??1HandleWatcher@common@mojo@@QAE@XZ) already defined in handle_watcher.obj

mojo.dll.lib(mojo.dll) : error LNK2005: "public: void __thiscall mojo::common::HandleWatcher::Start(class mojo::Handle const &,unsigned int,unsigned __int64,class base::Callback<void __cdecl(unsigned int)> const &)" (?Start@HandleWatcher@common@mojo@@QAEXABVHandle@3@I_KABV?$Callback@$$A6AXI@Z@base@@@z) already defined in handle_watcher.obj

ipc_mojo_unittests.exe : fatal error LNK1169: one or more multiply defined symbols found

Original issue's description:
> Gets gn check to execute cleanly in mojo/common
>
> This one is trickier. I'm changing mojo/common:common_base to be a
> source_set. Here's why. When I add the necessary deps, in particular
>     "//third_party/mojo/src/mojo/public/cpp/bindings:bindings",
> then I get link errors for the environment, eg
> gen/third_party/mojo/src/mojo/public/interfaces/bindings/interface_control_messages.mojom.cc:719: error: undefined reference to 'mojo::Environment::GetDefaultLogger()'
> These symbols are in //mojo/environment. If I add //mojo/environment
> to the list of deps for common_base I end up with a cycle as
> environment depends upon common_base. By changing to source_set
> common_base isn't linked and everyone is happy.
>
> As a result of this I had to consolidate //mojo/environment into a single source set.
>
> BUG=none
> TEST=none
> R=ben@chromium.org
>
> Committed: https://crrev.com/67b0a7be4ff751b1cf83be5af817a61ff7154aa8
> Cr-Commit-Position: refs/heads/master@{#340527}

TBR=ben@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=none

Review URL: https://codereview.chromium.org/1262503002

Cr-Commit-Position: refs/heads/master@{#340584}
  • Loading branch information
sky authored and Commit bot committed Jul 27, 2015
1 parent 71ea6a2 commit 393104d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .gn
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ check_targets = [
"mojo/application/*",
"mojo/build/*",
"mojo/cc/*",
"mojo/common/*",

# TODO(sky): resolve this.
# "mojo/common/*",
"mojo/converters/*",
"mojo/environment/*",

Expand Down
4 changes: 1 addition & 3 deletions mojo/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ group("common") {
}

# GYP version: mojo/mojo_base.gyp:mojo_common_lib
source_set("common_base") {
component("common_base") {
output_name = "mojo_common_lib"

sources = [
Expand Down Expand Up @@ -40,8 +40,6 @@ source_set("common_base") {
"//base",
"//base/third_party/dynamic_annotations",
"//third_party/mojo/src/mojo/public/c/system:for_component",
"//third_party/mojo/src/mojo/public/cpp/bindings:bindings",
"//third_party/mojo/src/mojo/public/cpp/system:system",
]
}

Expand Down
40 changes: 28 additions & 12 deletions mojo/environment/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ source_set("chromium") {
output_name = "mojo_environment_chromium"

sources = [
"default_async_waiter_impl.cc",
"default_async_waiter_impl.h",
"default_logger_impl.cc",
"default_logger_impl.h",
"default_run_loop_impl.cc",
"default_run_loop_impl.h",
"default_task_tracker_impl.cc",
"default_task_tracker_impl.h",
"environment.cc",

# TODO(vtl): This is kind of ugly. (See TODO in logging.h.)
Expand All @@ -27,19 +19,43 @@ source_set("chromium") {
"//third_party/mojo/src/mojo/public/cpp/environment/task_tracker.h",
]

public_deps = [
":chromium_impl",
]

deps = [
"//base",
"//base/third_party/dynamic_annotations",
"//mojo/common:common_base",
"//third_party/mojo/src/mojo/public/cpp/environment:environment",
"//third_party/mojo/src/mojo/public/c/environment",
"//third_party/mojo/src/mojo/public/cpp/bindings:callback",
"//third_party/mojo/src/mojo/public/cpp/environment",
"//third_party/mojo/src/mojo/public/cpp/system",
]
}

# GYP version: mojo_base.gyp:mojo_environment_chromium_impl
component("chromium_impl") {
output_name = "mojo_environment_impl"
visibility = [ "//mojo/*" ]

sources = [
"default_async_waiter_impl.cc",
"default_async_waiter_impl.h",
"default_logger_impl.cc",
"default_logger_impl.h",
"default_run_loop_impl.cc",
"default_run_loop_impl.h",
"default_task_tracker_impl.cc",
"default_task_tracker_impl.h",
]

defines = [ "MOJO_ENVIRONMENT_IMPL_IMPLEMENTATION" ]

public_configs =
[ "//third_party/mojo/src/mojo/public/build/config:mojo_sdk" ]

deps = [
"//base",
"//base/third_party/dynamic_annotations",
"//mojo/common:common_base",
"//third_party/mojo/src/mojo/public/cpp/environment:environment",
]
}

0 comments on commit 393104d

Please sign in to comment.