Skip to content

Commit

Permalink
[GN/iOS] Create a symlink to iossim for compatibility with gyp.
Browse files Browse the repository at this point in the history
Add a //testing/iossim target on the default_toolchain that symlink
to //testing/iossim($host_toolchain) for compatibility with gyp and
bots.

BUG=459705

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

Cr-Commit-Position: refs/heads/master@{#387201}
  • Loading branch information
sdefresne authored and Commit bot committed Apr 14, 2016
1 parent 5e45bd7 commit 89488f0
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 43 deletions.
2 changes: 1 addition & 1 deletion build/config/ios/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ template("ios_app_bundle") {
if (!defined(data_deps)) {
data_deps = []
}
data_deps += [ "//testing/iossim(${host_toolchain})" ]
data_deps += [ "//testing/iossim" ]
}

bundle_root_dir = "$root_out_dir/$_output_name.app"
Expand Down
93 changes: 51 additions & 42 deletions testing/iossim/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,63 @@
# found in the LICENSE file.

import("//build/config/mac/mac_sdk.gni")
import("//build/symlink.gni")
import("//third_party/class-dump/class-dump.gni")

config("config") {
visibility = [ ":iossim" ]
if (current_toolchain == host_toolchain) {
config("config") {
visibility = [ ":iossim" ]

include_dirs = [ "$root_gen_dir/iossim" ]
include_dirs = [ "$root_gen_dir/iossim" ]

# TODO(crbug.com/595295): Building class-dump tools requires OS X SDK
# version 10.9 or higher. Remove this override once the global version
# of the SDK is raised.
common_flags = [ "-mmacosx-version-min=10.9" ]
ldflags = common_flags
cflags_objcc = common_flags
}
# TODO(crbug.com/595295): Building class-dump tools requires OS X SDK
# version 10.9 or higher. Remove this override once the global version
# of the SDK is raised.
common_flags = [ "-mmacosx-version-min=10.9" ]
ldflags = common_flags
cflags_objcc = common_flags
}

executable("iossim") {
sources = [
"iossim.mm",
]
libs = [ "Foundation.framework" ]
deps = [
":generate_dvt_core_simulator",
":generate_dvt_foundation_header",
":generate_dvt_iphone_sim_header",
]
configs += [ ":config" ]

# TODO(crbug.com/595295): Building class-dump tools requires OS X SDK
# version 10.9 or higher. To prevent mixing code using different value
# of minimum SDK supported, forbids dependencies on any Chromium target.
assert_no_deps = [ "//base/*" ]
}
executable("iossim") {
sources = [
"iossim.mm",
]
libs = [ "Foundation.framework" ]
deps = [
":generate_dvt_core_simulator",
":generate_dvt_foundation_header",
":generate_dvt_iphone_sim_header",
]
configs += [ ":config" ]

class_dump("generate_dvt_core_simulator") {
framework_name = "CoreSimulator"
framework_path = "$mac_sdk_path/../../../../../Library/PrivateFrameworks"
class_dump_filter = "Sim"
}
# TODO(crbug.com/595295): Building class-dump tools requires OS X SDK
# version 10.9 or higher. To prevent mixing code using different value
# of minimum SDK supported, forbids dependencies on any Chromium target.
assert_no_deps = [ "//base/*" ]
}

class_dump("generate_dvt_foundation_header") {
framework_name = "DVTFoundation"
framework_path = "$mac_sdk_path/../../../../../../SharedFrameworks"
class_dump_filter = "DVTStackBacktrace|DVTInvalidation|DVTMixIn"
}
class_dump("generate_dvt_core_simulator") {
framework_name = "CoreSimulator"
framework_path = "$mac_sdk_path/../../../../../Library/PrivateFrameworks"
class_dump_filter = "Sim"
}

class_dump("generate_dvt_foundation_header") {
framework_name = "DVTFoundation"
framework_path = "$mac_sdk_path/../../../../../../SharedFrameworks"
class_dump_filter = "DVTStackBacktrace|DVTInvalidation|DVTMixIn"
}

class_dump("generate_dvt_iphone_sim_header") {
topological_sort = true
framework_name = "DVTiPhoneSimulatorRemoteClient"
framework_path = "$mac_sdk_path/../../../../../../SharedFrameworks"
class_dump_filter = "iPhoneSimulator"
class_dump("generate_dvt_iphone_sim_header") {
topological_sort = true
framework_name = "DVTiPhoneSimulatorRemoteClient"
framework_path = "$mac_sdk_path/../../../../../../SharedFrameworks"
class_dump_filter = "iPhoneSimulator"
}
} else if (current_toolchain == default_toolchain) {
binary_symlink("iossim") {
# This creates an 'iossim' target in root_build_dir for compatibility
# with GYP and the test scripts.
binary_label = ":iossim($host_toolchain)"
}
}

0 comments on commit 89488f0

Please sign in to comment.