Sloppy's Blog

NDK编译出现make(**文件名过长)的解决方案

随着项目文件的变多,最近在Windows上编译Android版本的时候,会出现make(**206,文件名过长的问题),google了一下,发现Windows的命令行的限制,以下是摘自Android开发网站的解释(https://developer.android.com/ndk/guides/android_mk.html)

This feature can be useful on Windows, where the command line accepts a maximum of only of 8191 characters, which can be too small for complex projects. It also impacts the compilation of individual source files, placing nearly all compiler flags inside list files, too.

两种解决方案:

  • 一种是在Android.mk文件中,添加编译设置:LOCAL_SHORT_COMMANDS := true
  • 二种是在Application.mk文件中:APP_SHORT_COMMANDS:=true

第二种,可能会造成全部的编译慢一些