Allow building mojo_shell and non-graphical apps/services on a Mac
The goal of this patch is to allow hacking on some pieces of the system
from a Mac, such as the generated bindings code and simple examples. It
is not the goal of this patch to make everything (or even most things)
work, or to support this as a development platform in general, just to
get the easy things going so folks can do some useful work from their
laptops on buses and whatnot.
This fixes up several compilation and link errors that show up building
on a Mac host and makes things that don't compile conditional in the
build system. mojo_shell and many of our unit test binaries run with
this patch if the current working directory is the out dir, but they're
missing some piece of rpath magic in order to run from anywhere.
mojob.py test doesn't do anything on a mac yet (and it's not clear what
it should do).
None of the graphics system is compiled in with this patch primiarily
for two reasons:
*) Lots of link errors in ui/ for events related code
*) Some link errors for CGL symbols as we don't appear to have the
right frameworks configured in the GPU targets.
Depends on https://codereview.chromium.org/1313973005 to fix a linker
error in dart about having zero source files.
R=kulakowski@chromium.org, viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/1327033004 .
diff --git a/shell/BUILD.gn b/shell/BUILD.gn
index 256bfd2..b201e6b 100644
--- a/shell/BUILD.gn
+++ b/shell/BUILD.gn
@@ -37,8 +37,11 @@
":mojo_shell_tests",
":shell_nfc_apptests",
"//shell/application_manager:mojo_application_manager_unittests",
- "//shell/crash:crash_unittests",
]
+
+ if (is_android || is_linux) {
+ deps += [ "//shell/crash:crash_unittests" ]
+ }
}
if (is_android) {
@@ -54,10 +57,13 @@
"//build/config/sanitizers:deps",
"//mojo/environment:chromium",
"//mojo/message_pump",
- "//shell/crash",
]
shell_common_data_deps = [ ":mojo_shell_child" ]
+ if (is_android || is_linux) {
+ shell_common_deps += [ "//shell/crash" ]
+ }
+
if (is_android) {
shared_library("mojo_shell") {
sources = [
@@ -232,6 +238,15 @@
"//services/native_viewport:lib",
]
}
+
+ if (is_mac) {
+ sources -= [
+ "url_response_disk_cache_loader.cc",
+ "url_response_disk_cache_loader.h",
+ ]
+
+ deps -= [ "//services/url_response_disk_cache" ]
+ }
}
# This is a separate target mainly since it suppresses check_includes.
@@ -561,6 +576,9 @@
public_deps = [
"//shell/test:pingable_app($default_toolchain)",
]
+ sources = [
+ "pingable_app_dummy_empty.cc",
+ ]
}
embed_file("embed_pingable") {