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

Unified Diff: build/config/mac/BUILD.gn

Issue 2023703002: Beginning work on GN build (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Really add //build. Add dart_bootstrap rule. 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
« no previous file with comments | « build/config/locales.gni ('k') | build/config/mac/BuildInfo.plist » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/mac/BUILD.gn
diff --git a/build/config/mac/BUILD.gn b/build/config/mac/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..56e101cee713f3350170e5aeb007afe882bab157
--- /dev/null
+++ b/build/config/mac/BUILD.gn
@@ -0,0 +1,88 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/sysroot.gni")
+import("//build/config/mac/mac_sdk.gni")
+
+# This is included by reference in the //build/config/compiler config that
+# is applied to all targets. It is here to separate out the logic.
+#
+# This is applied to BOTH desktop Mac and iOS targets.
+config("compiler") {
+ # These flags are shared between the C compiler and linker.
+ common_mac_flags = []
+
+ # CPU architecture.
+ if (current_cpu == "x64") {
+ common_mac_flags += [
+ "-arch",
+ "x86_64",
+ ]
+ } else if (current_cpu == "x86") {
+ common_mac_flags += [
+ "-arch",
+ "i386",
+ ]
+ } else if (current_cpu == "armv7" || current_cpu == "arm") {
+ common_mac_flags += [
+ "-arch",
+ "armv7",
+ ]
+ } else if (current_cpu == "arm64") {
+ common_mac_flags += [
+ "-arch",
+ "arm64",
+ ]
+ }
+
+ asmflags = common_mac_flags
+ cflags = common_mac_flags
+
+ # Without this, the constructors and destructors of a C++ object inside
+ # an Objective C struct won't be called, which is very bad.
+ cflags_objcc = [ "-fobjc-call-cxx-cdtors" ]
+
+ cflags_c = [ "-std=c99" ]
+ cflags_objc = cflags_c
+
+ ldflags = common_mac_flags
+}
+
+# This is included by reference in the //build/config/compiler:runtime_library
+# config that is applied to all targets. It is here to separate out the logic
+# that is Mac-only. Please see that target for advice on what should go in
+# :runtime_library vs. :compiler.
+config("runtime_library") {
+ common_flags = [
+ "-isysroot",
+ sysroot,
+ "-mmacosx-version-min=$mac_deployment_target",
+ ]
+
+ asmflags = common_flags
+ cflags = common_flags
+ ldflags = common_flags
+}
+
+# On Mac, this is used for everything except static libraries.
+config("mac_dynamic_flags") {
+ ldflags = []
+
+ if (is_component_build) {
+ ldflags += [
+ # Path for loading shared libraries for unbundled binaries.
+ "-Wl,-rpath,@loader_path/.",
+
+ # Path for loading shared libraries for bundled binaries. Get back from
+ # Binary.app/Contents/MacOS.
+ "-Wl,-rpath,@loader_path/../../..",
+ ]
+ }
+}
+
+# On Mac, this is used only for executables.
+config("mac_executable_flags") {
+ # Remove this when targeting >=10.7 since it is the default in that config.
+ ldflags = [ "-Wl,-pie" ] # Position independent.
+}
« no previous file with comments | « build/config/locales.gni ('k') | build/config/mac/BuildInfo.plist » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698