Add option to update the MSVC cl.exe dir for all builds (#4773)

CMakeCache.txt and other files (rules.ninja, other .cmake files) save
the full path to the cl.exe binary, including the specific MSVC
version. We've added an option to update that specific version to
continue using all builds/configurations with the new updated path to
cl.exe.
This commit is contained in:
David Capello 2024-12-02 00:07:30 -03:00
parent 8241e03612
commit 0905e974cd
2 changed files with 35 additions and 4 deletions

View File

@ -259,6 +259,7 @@ if [[ $n -eq 1 ]] ; then
echo "First build directory: $active_build_dir" echo "First build directory: $active_build_dir"
else else
echo "N. New build (N key)" echo "N. New build (N key)"
echo "U. Update Visual Studio/Windows Kit/macOS SDK version (U key)"
read -p "Select an option or number to build? " build_n read -p "Select an option or number to build? " build_n
# New build # New build
@ -277,7 +278,37 @@ else
new_build_name=$REPLY new_build_name=$REPLY
fi fi
active_build_dir="$builds_dir/$new_build_name" active_build_dir="$builds_dir/$new_build_name"
else
# Update SDK
elif [[ "$build_n" == "u" || "$build_n" == "U" ]] ; then
echo "Update SDK dirs..."
if [ $is_win ] ; then
newclver=$(echo $VCToolsInstallDir | sed -e 's_^.*\\\([0-9\.]*\)\\$_\1_')
function update_file {
file=$1
echo "--- Updating $file ---" | tee -a "$pwd/.build/log"
mv "$file" "$file-old"
cat "$file-old" | sed -e 's_^\(.*/VC/Tools/MSVC/\)\([0-9\.]*\)\(.*$\)_\1'$newclver'\3_' > "$file"
diff -w -u3 "$file-old" "$file" >> "$pwd/.build/log"
echo "--- End $file ---" >> "$pwd/.build/log"
}
echo "New VC version: $newclver"
for file in $(cat $builds_list) ; do
build_dir=$(dirname $file)
echo "--- Updating $build_dir ---"
update_file "$file"
for other_file in "$build_dir/CMakeFiles/rules.ninja" \
"$build_dir/third_party/libpng/scripts/genout.cmake" ; do
update_file "$other_file"
done
done
fi
echo "Done"
exit
else # Build the selected dir
n=1 n=1
for file in $(cat $builds_list) ; do for file in $(cat $builds_list) ; do
if [ "$n" == "$build_n" ] ; then if [ "$n" == "$build_n" ] ; then
@ -452,13 +483,13 @@ if [ ! -f "$active_build_dir/ninja.build" ] ; then
-DLAF_BACKEND=skia \ -DLAF_BACKEND=skia \
-DSKIA_DIR="$skia_dir" \ -DSKIA_DIR="$skia_dir" \
-DSKIA_LIBRARY_DIR="$skia_library_dir" | \ -DSKIA_LIBRARY_DIR="$skia_library_dir" | \
tee "$pwd/.build/log" ; then tee -a "$pwd/.build/log" ; then
echo "Error running cmake." echo "Error running cmake."
exit 1 exit 1
fi fi
fi fi
echo "============================== BUILDING ==============================" echo "============================== BUILDING =============================="
if ! cmake --build "$active_build_dir" -- aseprite | tee "$pwd/.build/log" ; then if ! cmake --build "$active_build_dir" -- aseprite | tee -a "$pwd/.build/log" ; then
echo "Error building Aseprite." echo "Error building Aseprite."
exit 1 exit 1
fi fi

2
laf

@ -1 +1 @@
Subproject commit a1c113aaa63ccf1e83024e283988e14da3ffba4d Subproject commit c6cd70ad9743197a05c7af5b5dd4c71ea61926f3