build-llvm: Set CMAKE_STRIP when cross compiling with Clang

If using Clang from /usr/bin, this makes it clear to CMake to use
$HOST-strip, as it otherwise may pick plain /usr/bin/strip, which
may not be able to strip the cross built executables.
This commit is contained in:
Martin Storsjö committed 2025-06-30 14:12:02 +03:00
1 parent 9d5860a02d
commit a41085f7d9
1 file changed
+3
+3
View File
@@ -194,6 +194,9 @@ if [ -n "$HOST" ]; then
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_ASM_COMPILER_TARGET=$HOST"
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_C_COMPILER_TARGET=$HOST"
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CXX_COMPILER_TARGET=$HOST"
if command -v $HOST-strip >/dev/null; then
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_STRIP=$(command -v $HOST-strip)"
fi
else
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_C_COMPILER=$HOST-gcc"
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CXX_COMPILER=$HOST-g++"