Commit 2461a73b authored by sdefresne's avatar sdefresne Committed by Commit bot

Add config to enable ARC on iOS/OS X to //build/config.

Add a new config //build/config/compiler:enable_arc that adds the
required flag to enable ARC (automatic reference counting).

BUG=594519

Review URL: https://codereview.chromium.org/1806513002

Cr-Commit-Position: refs/heads/master@{#381686}
parent fe0e7d28
...@@ -1335,3 +1335,13 @@ config("default_symbols") { ...@@ -1335,3 +1335,13 @@ config("default_symbols") {
assert(false) assert(false)
} }
} }
if (is_ios || is_mac) {
# On Mac and iOS, this enables support for ARC (automatic ref-counting).
# See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
config("enable_arc") {
common_flags = [ "-fobjc-arc" ]
cflags_objc = common_flags
cflags_objcc = common_flags
}
}
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
config("public_config") { config("config") {
visibility = [ ":gcdwebserver" ]
libs = [ libs = [
"CFNetwork.framework", "CFNetwork.framework",
"MobileCoreServices.framework", "MobileCoreServices.framework",
...@@ -16,14 +17,13 @@ config("public_config") { ...@@ -16,14 +17,13 @@ config("public_config") {
] ]
} }
config("internal_config") { config("private_config") {
visibility = [ ":gcdwebserver" ] visibility = [ ":gcdwebserver" ]
# TODO(crbug.com/569158): Suppresses warnings that are treated as errors # TODO(crbug.com/569158): Suppresses warnings that are treated as errors
# when minimum iOS version support is increased to iOS 9 and up. # when minimum iOS version support is increased to iOS 9 and up.
# This should be removed once all deprecation violations have been fixed. # This should be removed once all deprecation violations have been fixed.
cflags = [ "-Wno-deprecated-declarations" ] cflags = [ "-Wno-deprecated-declarations" ]
cflags_objc = [ "-fobjc-arc" ]
} }
source_set("gcdwebserver") { source_set("gcdwebserver") {
...@@ -60,6 +60,9 @@ source_set("gcdwebserver") { ...@@ -60,6 +60,9 @@ source_set("gcdwebserver") {
"src/GCDWebServer/Responses/GCDWebServerStreamedResponse.m", "src/GCDWebServer/Responses/GCDWebServerStreamedResponse.m",
] ]
public_configs = [ ":public_config" ] public_configs = [ ":config" ]
configs += [ ":internal_config" ] configs += [
":private_config",
"//build/config/compiler:enable_arc",
]
} }
...@@ -175,25 +175,20 @@ copy("ochamcrest_copy_files") { ...@@ -175,25 +175,20 @@ copy("ochamcrest_copy_files") {
] ]
} }
config("ochamcrest_config") { config("config") {
visibility = [ ":ochamcrest" ] visibility = [ ":ochamcrest" ]
libs = [ "XCTest.framework" ] libs = [ "XCTest.framework" ]
include_dirs = [ "$root_gen_dir/ios/third_party/ochamcrest" ] include_dirs = [ "$root_gen_dir/ios/third_party/ochamcrest" ]
} }
config("ochamcrest_private_config") {
visibility = [ ":ochamcrest" ]
cflags_objc = [ "-fobjc-arc" ]
}
source_set("ochamcrest") { source_set("ochamcrest") {
testonly = true testonly = true
configs += [ configs += [
":ochamcrest_config", ":config",
":ochamcrest_private_config", "//build/config/compiler:enable_arc",
"//build/config/compiler:no_chromium_code", "//build/config/compiler:no_chromium_code",
] ]
public_configs = [ ":ochamcrest_config" ] public_configs = [ ":config" ]
public_deps = [ public_deps = [
":ochamcrest_copy_files", ":ochamcrest_copy_files",
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment