Use LOCAL_CXX with a dummy compiler to determine the build/link flags the build system will use to build a typical Android executable. This both prevents test failures when the build system simply goes out of sync with the old, hard coded flags, and helps us catch new failures introduced by build system changes ASAP. Change-Id: I9a867ab49b7f2158070cf944c7a96084089a3718
17 lines
495 B
Bash
Executable File
17 lines
495 B
Bash
Executable File
#!/bin/bash
|
|
CXX=$1
|
|
ARGS=${*:2}
|
|
DIR=external/libcxx/buildcmds
|
|
echo $ANDROID_BUILD_TOP/$CXX > $DIR/cxx_under_test
|
|
|
|
echo $ARGS | grep -P '\S+\.cpp\b' > /dev/null
|
|
if [ $? -eq 0 ]; then
|
|
echo $ARGS | perl -ne 's/\S+\.cpp\b/%SOURCE%/; print' \
|
|
| perl -ne 's/\S+\.o\b/%OUT%/; print' > $DIR/cxx.cmds
|
|
else
|
|
echo $ARGS | perl -ne 's/out\/target\/product\/\S+\/EXECUTABLES\/\S+\.o\b/%SOURCE%/; print' \
|
|
| perl -ne 's/-o\s+\S+\b/-o %OUT%/; print' > $DIR/link.cmds
|
|
fi
|
|
|
|
$CXX $ARGS
|