@@ -292,16 +292,19 @@ void PatchCpuFeaturesTarget()
292292 # Patched by alphaSkia: NDK r26+ removed sources/android/cpufeatures/.
293293 # cpu_features_ndk_compat points at the ndk_compat shim from google/cpu_features
294294 # (https://github.com/google/cpu_features), the official API-compatible replacement.
295+ # cpu_features_include points at the include/ directory of that library, which
296+ # ndk_compat/cpu-features.c needs for cpu_features_macros.h and related headers.
295297
296298 declare_args() {
297299 cpu_features_ndk_compat = ""
300+ cpu_features_include = ""
298301 }
299302
300303 import("../third_party.gni")
301304
302305 third_party("cpu-features") {
303306 if (cpu_features_ndk_compat != "") {
304- public_include_dirs = [ cpu_features_ndk_compat ]
307+ public_include_dirs = [ cpu_features_ndk_compat, cpu_features_include ]
305308 sources = [ cpu_features_ndk_compat + "/cpu-features.c" ]
306309 } else {
307310 public_include_dirs = [ "$ndk/sources/android/cpufeatures" ]
@@ -383,6 +386,8 @@ void BuildSkia()
383386 {
384387 gnArgs [ "cpu_features_ndk_compat" ] =
385388 ( RootDirectory / "externals" / "cpu_features" / "ndk_compat" ) . ToString ( ) . Replace ( '\\ ' , '/' ) ;
389+ gnArgs [ "cpu_features_include" ] =
390+ ( RootDirectory / "externals" / "cpu_features" / "include" ) . ToString ( ) . Replace ( '\\ ' , '/' ) ;
386391 }
387392
388393 GnNinja ( $ "out/{ libDir } ", "skia" , gnArgs , gnFlags , SkiaPath ) ;
0 commit comments