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

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

Issue 2843493002: [ios] Partially decouple iOS and macOS GN configuration. (Closed)
Patch Set: Address comment. Created 3 years, 8 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/compiler/BUILD.gn ('k') | build/config/ios/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/ios/BUILD.gn
diff --git a/build/config/ios/BUILD.gn b/build/config/ios/BUILD.gn
index ec6b9e67bcfb5f1fa5a7acb1495f5d4e6d7d8ac7..71f87de3ff914a0112b14dcf86933f1842b5fcf1 100644
--- a/build/config/ios/BUILD.gn
+++ b/build/config/ios/BUILD.gn
@@ -23,6 +23,53 @@ declare_args() {
enable_ios_bitcode = false
}
+# 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.
+config("compiler") {
+ # These flags are shared between the C compiler and linker.
+ common_ios_flags = []
+
+ # CPU architecture.
+ if (current_cpu == "x64") {
+ common_ios_flags += [
+ "-arch",
+ "x86_64",
+ ]
+ } else if (current_cpu == "x86") {
+ common_ios_flags += [
+ "-arch",
+ "i386",
+ ]
+ } else if (current_cpu == "armv7" || current_cpu == "arm") {
+ common_ios_flags += [
+ "-arch",
+ "armv7",
+ ]
+ } else if (current_cpu == "arm64") {
+ common_ios_flags += [
+ "-arch",
+ "arm64",
+ ]
+ }
+
+ # This is here so that all files get recompiled after an Xcode update.
+ # (defines are passed via the command line, and build system rebuild things
+ # when their commandline changes). Nothing should ever read this define.
+ defines = [ "CR_XCODE_VERSION=$xcode_version" ]
+
+ asmflags = common_ios_flags
+ cflags = common_ios_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_ios_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 iOS-only. Please see that target for advice on what should go in
@@ -67,6 +114,9 @@ config("runtime_library") {
}
}
+config("ios_executable_flags") {
+}
+
config("ios_dynamic_flags") {
ldflags = [ "-Wl,-ObjC" ] # Always load Objective-C categories and class.
}
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | build/config/ios/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698