Simplify //mojo/public/c/system targets We don't support building mojo apps in the component build, so we can simplify these system targets a bit. We don't need to have everything depend on a forwarding group that always evaluates to the same thing in the mojo repo. The new targets are: //mojo/public/c/system which contains the system headers but no implementation. //mojo/public/platform/native:system which contains the system thunks and exported thunk setter, used by anything run by the shell. This is mostly used by the mojo_native_application template but is also used by a few targets that need to link as shared_lib but will ultimately be loaded by the shell. //mojo/edk/system provides the real implementation of the system calls and is used by the shell and a few tests. The :for_... groups need to stick around for now to keep chromium working, but once this rolls in to the chromium tree then these can be fixed up as well. R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/754963008
diff --git a/examples/device_name/BUILD.gn b/examples/device_name/BUILD.gn index 66f28b9..d534aaa 100644 --- a/examples/device_name/BUILD.gn +++ b/examples/device_name/BUILD.gn
@@ -10,10 +10,11 @@ deps = [ "//base", - "//mojo/public/c/system:for_shared_library", + "//mojo/public/c/system", "//mojo/public/cpp/application:standalone", "//mojo/public/cpp/bindings", "//mojo/public/cpp/utility", + "//mojo/public/platform/native:system", ":jni_headers", ]
diff --git a/mojo/go/BUILD.gn b/mojo/go/BUILD.gn index 4a8986f..a895508 100644 --- a/mojo/go/BUILD.gn +++ b/mojo/go/BUILD.gn
@@ -15,7 +15,8 @@ "sample_app/app.go", ] deps = [ - "//mojo/public/c/system:for_shared_library", + "//mojo/public/c/system", + "//mojo/public/platform/native:system", ] } } else if (is_linux) {
diff --git a/mojo/gpu/BUILD.gn b/mojo/gpu/BUILD.gn index 010a7d5..d91fc7a 100644 --- a/mojo/gpu/BUILD.gn +++ b/mojo/gpu/BUILD.gn
@@ -18,7 +18,7 @@ "//gpu/command_buffer/common", "//mojo/environment:chromium", "//mojo/public/c/gles2", - "//mojo/public/c/system:for_shared_library", + "//mojo/public/c/system", "//mojo/public/cpp/application", "//mojo/public/cpp/bindings", "//mojo/public/cpp/environment",
diff --git a/mojo/public/c/gles2/BUILD.gn b/mojo/public/c/gles2/BUILD.gn index 0a4d151..b680bec 100644 --- a/mojo/public/c/gles2/BUILD.gn +++ b/mojo/public/c/gles2/BUILD.gn
@@ -14,7 +14,7 @@ ":headers", ] deps = [ - "../../platform/native:gles2_thunks", + "../../platform/native:gles2", ] }
diff --git a/mojo/public/c/system/BUILD.gn b/mojo/public/c/system/BUILD.gn index d2393a4..6a3827c 100644 --- a/mojo/public/c/system/BUILD.gn +++ b/mojo/public/c/system/BUILD.gn
@@ -38,15 +38,9 @@ public_deps = [ ":system", ] - if (is_component_build) { - deps = [ - "../../../edk/system", - ] - } else { - deps = [ - "../../platform/native:system_thunks", - ] - } + deps = [ + "../../platform/native:system", + ] } group("for_component") {
diff --git a/mojo/public/mojo_application.gni b/mojo/public/mojo_application.gni index 6f738bd..4fb23c9 100644 --- a/mojo/public/mojo_application.gni +++ b/mojo/public/mojo_application.gni
@@ -62,7 +62,7 @@ if (use_prebuilt_mojo_shell) { copy_mojo_shell = - rebase_path("mojo/public/tools:copy_mojo_shell", ".", mojo_root) + rebase_path("mojo/public/tools:copy_mojo_shell", ".", mojo_root) } # Copy the prebuilt mojo_shell if using it. @@ -73,12 +73,17 @@ } } else { if (use_prebuilt_mojo_shell) { - datadeps = [ copy_mojo_shell ] + datadeps = [ + copy_mojo_shell, + ] } } deps = rebase_path([ - "mojo/public/c/system:for_shared_library", - ], ".", mojo_root) + "mojo/public/c/system", + "mojo/public/platform/native:system", + ], + ".", + mojo_root) if (defined(invoker.deps)) { deps += invoker.deps } @@ -116,9 +121,7 @@ testonly = invoker.testonly } - visibility = [ - ":${final_target_name}", - ] + visibility = [ ":${final_target_name}" ] } copy(final_target_name) { @@ -131,8 +134,12 @@ deps = [ ":${library_target_name}", ] - sources = [ "${root_out_dir}/${library_name}" ] - outputs = [ "${root_out_dir}/${output}" ] + sources = [ + "${root_out_dir}/${library_name}", + ] + outputs = [ + "${root_out_dir}/${output}", + ] } } @@ -159,7 +166,9 @@ ] output = zip_action_output - outputs = [ output ] + outputs = [ + output, + ] rebase_inputs = rebase_path(inputs, root_build_dir) rebase_output = rebase_path(output, root_build_dir) @@ -179,10 +188,14 @@ script = rebase_path("mojo/public/tools/prepend.py", ".", mojo_root) input = zip_action_output - inputs = [ input ] + inputs = [ + input, + ] output = mojo_output - outputs = [ output ] + outputs = [ + output, + ] rebase_input = rebase_path(input, root_build_dir) rebase_output = rebase_path(output, root_build_dir)
diff --git a/mojo/public/platform/native/BUILD.gn b/mojo/public/platform/native/BUILD.gn index 21382a6..a369e17 100644 --- a/mojo/public/platform/native/BUILD.gn +++ b/mojo/public/platform/native/BUILD.gn
@@ -4,12 +4,7 @@ import("../../mojo_sdk.gni") -mojo_sdk_source_set("system_thunks") { - mojo_sdk_visibility = [ - "mojo/public/c/system:for_component", - "mojo/public/c/system:for_shared_library", - ] - +mojo_sdk_source_set("system") { sources = [ "system_thunks.h", "system_thunks.cc", @@ -27,9 +22,7 @@ # source_set here, this flag change is not needed. } -mojo_sdk_source_set("gles2_thunks") { - mojo_sdk_visibility = [ "mojo/public/gles2:for_shared_library" ] - +mojo_sdk_source_set("gles2") { sources = [ "gles2_thunks.cc", "gles2_thunks.h",
diff --git a/mojo/public/python/BUILD.gn b/mojo/public/python/BUILD.gn index 8f10250..51bd6eb 100644 --- a/mojo/public/python/BUILD.gn +++ b/mojo/public/python/BUILD.gn
@@ -24,11 +24,12 @@ deps = [ ":base", "../c/environment", - "../c/system:for_shared_library", + "../c/system", "../cpp/environment:standalone", "../cpp/system", "../cpp/utility", "../cpp/bindings:callback", + "../platform/native:system", ] } @@ -47,11 +48,12 @@ deps = [ ":base", "../c/environment", - "../c/system:for_shared_library", + "../c/system", "../cpp/environment:standalone", "../cpp/system", "../cpp/utility", "../cpp/bindings:callback", + "../platform/native:system", ] }
diff --git a/sky/engine/core/BUILD.gn b/sky/engine/core/BUILD.gn index 3635f2a..cea3c4b 100644 --- a/sky/engine/core/BUILD.gn +++ b/sky/engine/core/BUILD.gn
@@ -17,7 +17,7 @@ "//gpu/command_buffer/client:gles2_c_lib", "//mojo/application", "//mojo/common", - "//mojo/public/c/system:for_shared_library", + "//mojo/public/c/system", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//mojo/public/cpp/utility",
diff --git a/sky/engine/platform/BUILD.gn b/sky/engine/platform/BUILD.gn index b11c2d5..51f78d7 100644 --- a/sky/engine/platform/BUILD.gn +++ b/sky/engine/platform/BUILD.gn
@@ -84,11 +84,9 @@ ] } -component("platform") { +source_set("platform") { visibility += [ "//sky/*" ] - output_name = "sky_platform" - sources = [ "animation/AnimationUtilities.h", "animation/AnimationValue.h", @@ -644,7 +642,7 @@ "//mojo/application", "//mojo/common", "//mojo/environment:chromium", - "//mojo/public/c/system:for_shared_library", + "//mojo/public/c/system", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//mojo/public/cpp/utility", @@ -756,6 +754,12 @@ "//url", ] + # TODO(abarth): This is a lie - this test is not embedded in an environment + # that injects the system thunks, so system calls don't actually work. This + # just tricks the linker into thinking that an implementation of these calls + # will be injected at runtime so the link succeeds. + deps += [ "//mojo/public/platform/native:system" ] + defines = [ "INSIDE_BLINK" ] include_dirs = [ "$root_build_dir" ]
diff --git a/sky/engine/web/BUILD.gn b/sky/engine/web/BUILD.gn index bfd4a35..0c27709 100644 --- a/sky/engine/web/BUILD.gn +++ b/sky/engine/web/BUILD.gn
@@ -137,8 +137,8 @@ "//base", "//base/test:test_support", "//base:i18n", - "//sky/engine/wtf:test_support", "//sky/engine/testing/platform", + "//sky/engine/wtf:test_support", "//testing/gmock", "//testing/gtest", "//third_party/zlib", @@ -148,6 +148,12 @@ ":web", ] + # TODO(abarth): This is a lie - this test is not embedded in an environment + # that injects the system thunks, so system calls don't actually work. This + # just tricks the linker into thinking that an implementation of these calls + # will be injected at runtime so the link succeeds. + deps += [ "//mojo/public/platform/native:system" ] + sources = [ "tests/RunAllTests.cpp", ]