Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2463)

Unified Diff: chrome/BUILD.gn

Issue 1961473003: [Mac/GN] Set up the component build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/BUILD.gn
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index c65eb9930b713821629aa5c45a6c6d62c63b5f7e..23eaded221b09180550558bea29f7b66ca0a17c0 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -231,25 +231,6 @@ if (!is_android && !is_mac) {
}
} # !is_android && !is_mac
-if (is_mac) {
- if (is_component_build) {
- # On Mac component builds, this target is the bundle, and the main dll is
- # just another shared library. This speeds up incremental builds by
- # not requiring re-doing the bundle every time main_dll changes.
- # See https://codereview.chromium.org/11420019
-
- # TODO(GYP) chrome_dll for Mac component build.
- assert(false)
- } else {
- # On Mac non-component builds, this is a no-op forwarding target.
- group("chrome_dll") {
- public_deps = [
- ":chrome_framework",
- ]
- }
- }
-}
-
if (is_win) {
# This target is a forwarding target to compile the necessary DLLs used
# by Chrome.
@@ -402,12 +383,6 @@ if (is_win) {
group("chrome") {
deps = [
- ":chrome_initial",
- ]
- }
-
- group("chrome_initial") {
- deps = [
":chrome_app",
]
}
@@ -571,6 +546,11 @@ if (is_win) {
deps = [
"//chrome/common:version_header",
]
+
+ ldflags = [
+ "-rpath",
+ "@loader_path/../../../../../../..",
Dirk Pranke 2016/05/06 22:10:07 same question ...
Robert Sesek 2016/05/06 22:20:49 Commented.
+ ]
}
bundle_data("chrome_framework_locales") {
@@ -665,10 +645,20 @@ if (is_win) {
]
}
- mac_framework_bundle("chrome_framework") {
- output_name = chrome_framework_name
-
- configs += [ "//build/config/compiler:wexit_time_destructors" ]
+ # On Mac, speed up the component build by not re-bundling the framework
+ # every time it changes. Instead, place all the sources and their deps in
+ # a library that the bundled framework links (and re-exports). That way
+ # only the library needs to be re-linked when it changes.
+ if (is_component_build) {
+ _dll_target_type = "shared_library"
+ } else {
+ _dll_target_type = "source_set"
+ }
+ target(_dll_target_type, "chrome_dll") {
+ visibility = [
+ ":chrome_framework",
+ ":chrome_framework_shared_library",
+ ]
sources = [
"app/chrome_command_ids.h",
@@ -683,30 +673,59 @@ if (is_win) {
"app/chrome_main_mac.mm",
]
+ deps = [
+ ":browser_dependencies",
+ ":child_dependencies",
+ "//chrome/common:features",
+ "//components/crash/content/app",
+ "//components/policy",
+ "//content/public/app:both",
+ "//third_party/cld_2",
+ ]
+
+ if (is_component_build) {
+ libs = [ "Carbon.framework" ]
+ }
+
+ ldflags = [
+ "-Wl,-order_file",
+ "-Wl," + rebase_path("app/framework.order", root_build_dir),
+ "-ObjC",
+ ]
+
+ if (enable_plugins && enable_pdf) {
+ deps += [ "//pdf" ]
+ }
+
+ if (enable_package_mash_services) {
+ deps += [ "//chrome/app/mash" ]
+ }
+ }
+
+ mac_framework_bundle("chrome_framework") {
+ output_name = chrome_framework_name
+
+ configs += [ "//build/config/compiler:wexit_time_destructors" ]
+
info_plist_target = ":chrome_framework_plist"
extra_substitutions = [
"CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id",
"CHROMIUM_SHORT_NAME=$chrome_product_short_name",
]
+ public_deps = [
+ ":chrome_dll",
+ ]
+
deps = [
- ":browser_dependencies",
- ":child_dependencies",
":chrome_framework_helpers",
":chrome_framework_locales",
":chrome_framework_resources",
"//build/config/sanitizers:deps",
"//chrome/app/nibs:chrome_xibs",
- "//chrome/common:features",
- "//components/crash/content/app",
- "//components/policy",
- "//content/public/app:both",
- "//third_party/cld_2",
]
ldflags = [
- "-Wl,-order_file",
- "-Wl," + rebase_path("app/framework.order", root_build_dir),
"-install_name",
"@executable_path/../Versions/$chrome_version_full/$chrome_framework_name.framework/$chrome_framework_name",
"-compatibility_version",
@@ -715,12 +734,12 @@ if (is_win) {
chrome_dylib_version,
]
- if (enable_plugins && enable_pdf) {
- deps += [ "//pdf" ]
- }
-
- if (enable_package_mash_services) {
- deps += [ "//chrome/app/mash" ]
+ if (is_component_build) {
+ ldflags += [
+ "-rpath",
+ "@loader_path/../../../../..",
+ "-Wl,-reexport_library,libchrome_dll.dylib",
+ ]
}
}
}

Powered by Google App Engine
This is Rietveld 408576698