mirror of https://github.com/PCSX2/pcsx2.git
Merge branch 'EmperorArthur-build_with_spaces'
This commit is contained in:
commit
4ac17428ac
38
build.sh
38
build.sh
|
@ -100,15 +100,15 @@ for ARG in "$@"; do
|
||||||
done
|
done
|
||||||
|
|
||||||
root=$PWD/$(dirname "$0")
|
root=$PWD/$(dirname "$0")
|
||||||
log=$root/install_log.txt
|
log="$root/install_log.txt"
|
||||||
build=$root/build
|
build="$root/build"
|
||||||
coverity_dir=cov-int
|
coverity_dir="`cov-int`"
|
||||||
coverity_result=pcsx2-coverity.xz
|
coverity_result=pcsx2-coverity.xz
|
||||||
|
|
||||||
if [[ "$cleanBuild" -eq 1 ]]; then
|
if [[ "$cleanBuild" -eq 1 ]]; then
|
||||||
echo "Doing a clean build."
|
echo "Doing a clean build."
|
||||||
# allow to keep build as a symlink (for example to a ramdisk)
|
# allow to keep build as a symlink (for example to a ramdisk)
|
||||||
rm -fr $build/*
|
rm -fr "$build"/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$useCross" -eq 2 ]] && [[ "$(getconf LONG_BIT 2> /dev/null)" != 32 ]]; then
|
if [[ "$useCross" -eq 2 ]] && [[ "$(getconf LONG_BIT 2> /dev/null)" != 32 ]]; then
|
||||||
|
@ -118,26 +118,26 @@ elif [[ "$useCross" -ne 1 ]]; then
|
||||||
useCross=0
|
useCross=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Building pcsx2 with ${flags[*]}" | tee $log
|
echo "Building pcsx2 with ${flags[*]}" | tee "$log"
|
||||||
|
|
||||||
# Resolve the symlink otherwise cmake is lost
|
# Resolve the symlink otherwise cmake is lost
|
||||||
# Besides, it allows 'mkdir' to create the real destination directory
|
# Besides, it allows 'mkdir' to create the real destination directory
|
||||||
if [[ -L $build ]]; then
|
if [[ -L "$build" ]]; then
|
||||||
build=`readlink $build`
|
build=`readlink "$build"`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p $build
|
mkdir -p "$build"
|
||||||
# Cmake will generate file inside $CWD. It would be nicer if an option to cmake can be provided.
|
# Cmake will generate file inside $CWD. It would be nicer if an option to cmake can be provided.
|
||||||
cd $build
|
cd "$build"
|
||||||
|
|
||||||
if [[ "$useClang" -eq 1 ]]; then
|
if [[ "$useClang" -eq 1 ]]; then
|
||||||
if [[ "$useCross" -eq 0 ]]; then
|
if [[ "$useCross" -eq 0 ]]; then
|
||||||
CC=clang CXX=clang++ cmake "${flags[@]}" $root 2>&1 | tee -a $log
|
CC=clang CXX=clang++ cmake "${flags[@]}" "$root" 2>&1 | tee -a "$log"
|
||||||
else
|
else
|
||||||
CC="clang -m32" CXX="clang++ -m32" cmake "${flags[@]}" $root 2>&1 | tee -a $log
|
CC="clang -m32" CXX="clang++ -m32" cmake "${flags[@]}" "$root" 2>&1 | tee -a "$log"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
cmake "${flags[@]}" $root 2>&1 | tee -a $log
|
cmake "${flags[@]}" "$root" 2>&1 | tee -a "$log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,11 +160,11 @@ if [[ "$cppcheck" -eq 1 ]] && [[ -x `which cppcheck` ]]; then
|
||||||
do
|
do
|
||||||
flat_d=`echo $d | sed -e 's@/@_@'`
|
flat_d=`echo $d | sed -e 's@/@_@'`
|
||||||
log=cpp_check__${flat_d}.log
|
log=cpp_check__${flat_d}.log
|
||||||
rm -f $log
|
rm -f "$log"
|
||||||
|
|
||||||
cppcheck $check -j $ncpu --platform=unix32 $define $root/$d 2>&1 | tee $log
|
cppcheck $check -j $ncpu --platform=unix32 $define "$root/$d" 2>&1 | tee "$log"
|
||||||
# Create a small summary (warning it might miss some issues)
|
# Create a small summary (warning it might miss some issues)
|
||||||
fgrep -e "(warning)" -e "(error)" -e "(style)" -e "(performance)" -e "(portability)" $log >> $summary
|
fgrep -e "(warning)" -e "(error)" -e "(style)" -e "(performance)" -e "(portability)" "$log" >> $summary
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -198,16 +198,16 @@ fi
|
||||||
# Coverity build
|
# Coverity build
|
||||||
############################################################
|
############################################################
|
||||||
if [[ "$CoverityBuild" -eq 1 ]] && [[ -x `which cov-build` ]]; then
|
if [[ "$CoverityBuild" -eq 1 ]] && [[ -x `which cov-build` ]]; then
|
||||||
cov-build --dir $coverity_dir make -j"$ncpu" 2>&1 | tee -a $log
|
cov-build --dir "$coverity_dir" make -j"$ncpu" 2>&1 | tee -a "$log"
|
||||||
# Warning: $coverity_dir must be the root directory
|
# Warning: $coverity_dir must be the root directory
|
||||||
(cd $build; tar caf $coverity_result $coverity_dir)
|
(cd "$build"; tar caf $coverity_result "$coverity_dir")
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# Real build
|
# Real build
|
||||||
############################################################
|
############################################################
|
||||||
make -j"$ncpu" 2>&1 | tee -a $log
|
make -j"$ncpu" 2>&1 | tee -a "$log"
|
||||||
make install 2>&1 | tee -a $log
|
make install 2>&1 | tee -a "$log"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue