From 0c98e89fdbc28df95d26487e18f8049695fe6093 Mon Sep 17 00:00:00 2001 From: Greg McGary Date: Thu, 7 Dec 2017 13:18:16 -0800 Subject: [PATCH] Use clang-5.0 -Oz Summary: Use clang-5.0 -Oz as default NDK compiler for android. It does 3 good things: * brings us into compliance with deprecation of gcc for android NDKs since r13 * yields slightly smaller native code, on the order of many-10s-to-small-100s of KB * slight improvement in startup performance, on the order of 10s of ms Reviewed By: mzlee Differential Revision: D6155682 fbshipit-source-id: 2f64e742f4dc44be171274c2ad0a41fb1e7079d7 --- yoga/Yoga.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index fb0388d2..5bb0df89 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -133,6 +133,12 @@ static int YGDefaultLog(const YGConfigRef config, #endif bool YGFloatIsUndefined(const float value) { +// TODO(gkm): Ugh! Some Android builds (r13b & clang-3.8) fail +// with the kludge below, so we must tailor it specifically for +// NDK r15c which has clang-5.0. NDK r16 will make it all better. +#if __ANDROID__ && __clang_major__ == 5 // TODO(gkm): remove for NDK >= 16 + using std::isnan; +#endif return isnan(value); }