android 7.1 build out/target/product/angler/gen/EXECUTABLES/iw_intermediates/version.c

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xzx208/article/details/84028898

错误:

[  0% 43/19107] build out/target/product/angler/gen/EXECUTABLES/iw_intermediates/version.c

FAILED: /bin/bash -c "external/iw/version.sh out/target/product/angler/gen/EXECUTABLES/iw_intermediates/version.c"
fatal: 没有发现名称,无法描述任何东西。
[  0% 43/19107] target  C++: libart <= art/runtime/interpreter/interpreter_switch_impl.cc
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] 错误 1


#### make failed to build some targets (39 seconds) ####

解决:

vi external/iw/version.sh

可以看到如下:

#!/bin/sh


VERSION="4.1"
OUT="$1"


if [ -d .Git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
git update-index --refresh --unmerged > /dev/null
descr=$(git describe --match=v*)


# on git builds check that the version number above
# is correct...
[ "${descr%%-*}" = "v$VERSION" ] || exit 2


v="${descr#v}"
if git diff-index --name-only HEAD | read dummy ; then
v="$v"-dirty
fi
else
v="$VERSION"
fi


echo '#include "iw.h"' > "$OUT"
echo "const char iw_version[] = \"$v\";" >> "$OUT"

为了让这个脚本不走[ -d .git ]分支改成如下:

#!/bin/sh


VERSION="4.1"
OUT="$1"


#if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null` && [$VERSION != "4.1"]; then
git update-index --refresh --unmerged > /dev/null
descr=$(git describe --match=v*)


# on git builds check that the version number above
# is correct...
[ "${descr%%-*}" = "v$VERSION" ] || exit 2


v="${descr#v}"
if git diff-index --name-only HEAD | read dummy ; then
v="$v"-dirty
fi
else
v="$VERSION"
fi


echo '#include "iw.h"' > "$OUT"
echo "const char iw_version[] = \"$v\";" >> "$OUT"

猜你喜欢

转载自blog.csdn.net/xzx208/article/details/84028898