From 987360687ac551cbfdc0bdcc8ed53c7c48843abf Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Tue, 31 Jan 2017 13:26:15 -0500 Subject: [PATCH] Make flag parsing work in GN-built iOS nanobench. Just like DM. CQ_INCLUDE_TRYBOTS=skia.primary:Test-iOS-Clang-iPadMini4-GPU-GX6450-Arm7-Debug,Build-Mac-Clang-arm64-Debug-GN_iOS Change-Id: I4af3fa1813e3b7ee48407096e91373b5fee569c7 Reviewed-on: https://skia-review.googlesource.com/7824 Reviewed-by: Hal Canary Commit-Queue: Mike Klein --- bench/nanobench.cpp | 2 +- gn/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index 887fab3bad..c2afca65cb 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -1361,7 +1361,7 @@ int nanobench_main() { return 0; } -#if !defined SK_BUILD_FOR_IOS +#if !defined(SK_BUILD_FOR_IOS) || defined(NANOBENCH_DEFINE_MAIN) int main(int argc, char** argv) { SkCommandLineFlags::Parse(argc, argv); return nanobench_main(); diff --git a/gn/BUILD.gn b/gn/BUILD.gn index 11ab560a2e..cd7f8f74cf 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -212,7 +212,7 @@ config("default") { # our clever hack to give each tool back its own main(). cflags += [ "-DDM_DEFINE_MAIN", - "-Dnanobench_main=main", + "-DNANOBENCH_DEFINE_MAIN", "-Dtool_main=main", "-Dtest_main=main", ]