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

Side by Side Diff: build/config/ios/BUILD.gn

Issue 2789433004: Add tools for code coverage support in iOS. (Closed)
Patch Set: Nits Created 3 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/ios/ios_sdk.gni") 5 import("//build/config/ios/ios_sdk.gni")
6 import("//build/config/sysroot.gni") 6 import("//build/config/sysroot.gni")
7 import("//build/toolchain/toolchain.gni") 7 import("//build/toolchain/toolchain.gni")
8 8
9 declare_args() { 9 declare_args() {
10 # Enabling this option makes clang compile to an intermediate 10 # Enabling this option makes clang compile to an intermediate
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (use_xcode_clang && get_path_info(ios_sdk_version, "name") != "10") { 58 if (use_xcode_clang && get_path_info(ios_sdk_version, "name") != "10") {
59 common_cc_flags = [ 59 common_cc_flags = [
60 "-isystem", 60 "-isystem",
61 rebase_path("//third_party/llvm-build/Release+Asserts/include/c++/v1", 61 rebase_path("//third_party/llvm-build/Release+Asserts/include/c++/v1",
62 root_build_dir), 62 root_build_dir),
63 ] 63 ]
64 64
65 cflags_cc = common_cc_flags 65 cflags_cc = common_cc_flags
66 cflags_objcc = common_cc_flags 66 cflags_objcc = common_cc_flags
67 } 67 }
68
69 if (ios_enable_coverage) {
70 configs = [ ":enable_coverage" ]
71 }
68 } 72 }
69 73
70 config("ios_dynamic_flags") { 74 config("ios_dynamic_flags") {
71 ldflags = [ "-Wl,-ObjC" ] # Always load Objective-C categories and class. 75 ldflags = [ "-Wl,-ObjC" ] # Always load Objective-C categories and class.
72 } 76 }
73 77
74 config("xctest_config") { 78 config("xctest_config") {
75 common_flags = [ 79 common_flags = [
76 "-F", 80 "-F",
77 "$ios_sdk_platform_path/Developer/Library/Frameworks", 81 "$ios_sdk_platform_path/Developer/Library/Frameworks",
78 ] 82 ]
79 83
80 cflags = common_flags 84 cflags = common_flags
81 ldflags = common_flags 85 ldflags = common_flags
82 86
83 libs = [ 87 libs = [
84 "Foundation.framework", 88 "Foundation.framework",
85 "XCTest.framework", 89 "XCTest.framework",
86 ] 90 ]
87 } 91 }
88 92
93 # This enables support for LLVM code coverage. See
94 # http://llvm.org/docs/CoverageMappingFormat.html.
95 config("enable_coverage") {
96 cflags = [
97 "-fprofile-instr-generate",
98 "-fcoverage-mapping",
99 ]
100 ldflags = [ "-fprofile-instr-generate" ]
101 }
102
89 group("xctest") { 103 group("xctest") {
90 public_configs = [ ":xctest_config" ] 104 public_configs = [ ":xctest_config" ]
91 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698