gn, mac: Honor mac_sdk_min, sysroot, and mac_deployment_target

This is bit more flexible (and probably straightforward) than how
Chromium deals with things. The SDK is selected based on the first
non-empty GN argument out of sysroot, mac_sdk, and mac_sdk_min.
Regardless of how the SDK is selected, if mac_sdk is non-empty, the SDK
must be that exact version, and if mac_sdk_min is non-empty, the SDK
must be at least that version. It’s possible for all three to be empty,
which will result in the system’s default SDK being chosen, without any
additional constraints. This is the current default.

Similarly, mac_deployment_target may be empty, which allows the
toolchain to choose the deployment target. The current default is to
explicitly specify 10.9 as the deployment target.

Unlike Chromium, this ought to work on systems with only the Command
Line Tools package installed, but no Xcode. Also unlike Chromium, no
provision has been made (yet?) for the hermetic tools package.

The sysroot logic for macOS and Fuchsia has been consolidated, although
there’s probably more room for improvement.

Bug: crashpad:79
Change-Id: I1df56921bd68934b6c4671707ca47842b58047fe
Reviewed-on: https://chromium-review.googlesource.com/830892
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
3 files changed
tree: 5d504fd958fe344588dd4966eb952071cda387fb
  1. base/
  2. build/
  3. .gitignore
  4. AUTHORS
  5. BUILD.gn
  6. codereview.settings
  7. LICENSE
  8. mini_chromium.gyp
  9. README.md
README.md

mini_chromium

This is mini_chromium, a small collection of useful low-level (“base”) routines from the Chromium open-source project. Chromium is large, sprawling, full of dependencies, and a web browser. mini_chromium is small, self-contained, and a library. mini_chromium is especially useful as a dependency of other code that wishes to use Chromium’s base routines. By using mini_chromium, other projects’ code can function in a standalone environment outside of Chromium without having to treat all of Chromium as a dependency. When building as part of Chromium, those projects’ code can use Chromium’s own (non-mini_chromium) base implementation.

Code provided in mini_chromium provides the same interface as the equivalent code in Chromium.

While it’s a goal of mini_chromium to maintain interface compatibility with Chromium’s base library for the interfaces it does implement, there’s no requirement that it use the same implementations as Chromium’s base library. Many of the implementations used in mini_chromium are identical to Chromium’s, but many others have been modified to eliminate dependencies that are not desired in mini_chromium, and a few are completely distinct from Chromium’s altogether. Additionally, when mini_chromium provides an interface in the form of a file or class present in Chromium, it’s not bound to provide all functions, methods, or types that the Chromium equivalent does. The differences noted above notwithstanding, the interfaces exposed by mini_chromium’s base are and must remain a strict subset of Chromium’s.

Crashpad is the chief consumer of mini_chromium.

Mark Mentovai
mark@chromium.org