diff --git a/build.sh b/build.sh index 326e1bf5b..1c7bbe24d 100755 --- a/build.sh +++ b/build.sh @@ -259,6 +259,7 @@ if [[ $n -eq 1 ]] ; then echo "First build directory: $active_build_dir" else 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 # New build @@ -277,7 +278,37 @@ else new_build_name=$REPLY fi 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 for file in $(cat $builds_list) ; do if [ "$n" == "$build_n" ] ; then @@ -452,13 +483,13 @@ if [ ! -f "$active_build_dir/ninja.build" ] ; then -DLAF_BACKEND=skia \ -DSKIA_DIR="$skia_dir" \ -DSKIA_LIBRARY_DIR="$skia_library_dir" | \ - tee "$pwd/.build/log" ; then + tee -a "$pwd/.build/log" ; then echo "Error running cmake." exit 1 fi fi 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." exit 1 fi diff --git a/laf b/laf index a1c113aaa..c6cd70ad9 160000 --- a/laf +++ b/laf @@ -1 +1 @@ -Subproject commit a1c113aaa63ccf1e83024e283988e14da3ffba4d +Subproject commit c6cd70ad9743197a05c7af5b5dd4c71ea61926f3