refactor: change defined(MAS_BUILD) to IS_MAS_BUILD() (#36332)

* refactor: change defined(MAS_BUILD) to IS_MAS_BUILD()

This is missing-definition safe and thus allows us to move the definition of this macro away from "all compilation targets" to "just the compilation targets that depend on this macro".

In turn this makes the rebuild time changing from mas <-> darwin only 80 seconds on my machine, instead of the 12-15 minutes it used to take.  This will also allow us in the future to build both MAS and darwin on the same CI machine.  Costing us ~2 minutes on one machine but saving us anywhere from 30 minutes to an hour of CI time on other parts of the matrix.

* build: always define IS_MAS_BUILD even on non-mac builds

* build: use extra_configs
This commit is contained in:
Samuel Attard 2022-11-14 12:46:52 -08:00 committed by GitHub
parent d8bb172318
commit a9ef68f126
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 455 additions and 167 deletions

View file

@ -10,7 +10,7 @@ kinds of utility windows. Similarly for `disableAutoHideCursor`.
Additionally, disables usage of some private APIs in MAS builds.
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 22b03d5bd27f09731a3c2d6dbb03c7dc612a2975..274a7e784af522b8f58c36095ca6c0cdadb97671 100644
index 22b03d5bd27f09731a3c2d6dbb03c7dc612a2975..75e6a47f6b96695f3ef3c3a599bd70cb92935623 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -158,6 +158,15 @@ void ExtractUnderlines(NSAttributedString* string,
@ -65,7 +65,7 @@ index 22b03d5bd27f09731a3c2d6dbb03c7dc612a2975..274a7e784af522b8f58c36095ca6c0cd
// Since this implementation doesn't have to wait any IPC calls, this doesn't
// make any key-typing jank. --hbono 7/23/09
//
+#ifndef MAS_BUILD
+#if !IS_MAS_BUILD()
extern "C" {
extern NSString* NSTextInputReplacementRangeAttributeName;
}
@ -78,7 +78,7 @@ index 22b03d5bd27f09731a3c2d6dbb03c7dc612a2975..274a7e784af522b8f58c36095ca6c0cd
NSUnderlineColorAttributeName,
NSMarkedClauseSegmentAttributeName,
- NSTextInputReplacementRangeAttributeName, nil]);
+#ifndef MAS_BUILD
+#if !IS_MAS_BUILD()
+ NSTextInputReplacementRangeAttributeName,
+#endif
+ nil]);