diff options
author | Mike Klein <mtklein@chromium.org> | 2016-11-03 14:06:31 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-03 19:31:50 +0000 |
commit | 7d3028818ec1b6a653da45387ddf0fa01888cdda (patch) | |
tree | 2dd80fa3d35782b28966eba3d5be22838e40c8b7 /gn/BUILD.gn | |
parent | 4ef986db65027f53999174279252092ba9b03c9e (diff) |
GN: iOS basics
This doesn't create any apps or bundles or sign anything, but it all compiles and links.
Note the awkward transitional hack I used to make each tool's tool_main() serve as the real main() again when built with GN, while keeping the existing setup with GYP. Fun...
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4350
Change-Id: I632753d5d8e5848380854f413bf5905d676bfcf4
Reviewed-on: https://skia-review.googlesource.com/4350
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn/BUILD.gn')
-rw-r--r-- | gn/BUILD.gn | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn index 81813a39d2..a39217efb0 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -46,6 +46,10 @@ if (!is_win) { "value") } +if (is_ios) { + ios_sysroot = exec_script("find_ios_sysroot.py", [], "trim string") +} + config("default") { asmflags = [] cflags = [] @@ -178,6 +182,31 @@ config("default") { } } + if (is_ios) { + cflags += [ + "--sysroot=$ios_sysroot", + "--target=$target_cpu-apple-darwin11", + ] + cflags_cc += [ "-stdlib=libc++" ] + ldflags += [ + "--sysroot=$ios_sysroot", + "--target=$target_cpu-apple-darwin11", + "-stdlib=libc++", + ] + libs = [ "objc" ] + + # We used to link all our iOS tools together, so none actually defines main(). + # Instead they each define their own entry point, which our iOS mega-app called. + # If we can we'd like to not do that anymore. While we're building both ways, here's + # our clever hack to give each tool back its own main(). + cflags += [ + "-Ddm_main=main", + "-Dnanobench_main=main", + "-Dtool_main=main", + "-Dtest_main=main", + ] + } + if (is_linux) { libs = [ "pthread" ] } |