Move Windows dep build from MinGW/GCC to msys/MSVC #105502

Merged
Ray molenkamp merged 27 commits from Anthony-Roberts/blender:move-to-msys2 into main 2023-06-10 23:05:55 +02:00
2 changed files with 26 additions and 12 deletions
Showing only changes of commit 4491909d50 - Show all commits

View File

@ -3,12 +3,10 @@
set(GMP_EXTRA_ARGS -enable-cxx)
if(WIN32)
# Borrow a reasonably up-to-date ar-lib from webp to enable MSVC
cmake_to_msys_path("${BUILD_DIR}/webp/src/external_webp/ar-lib" arlib_path)
cmake_to_msys_path("${BUILD_DIR}/gmp/src/external_gmp/compile" compilescript_path)
Anthony-Roberts marked this conversation as resolved
Review

This gives me the Heebie-jeebies, i'd rather see this as a patch for gmp or put the script straight up in build_files\build_environment\patches\

the dep between gmp and webp just doesn't sit right with me.

This gives me the Heebie-jeebies, i'd rather see this as a patch for gmp or put the script straight up in `build_files\build_environment\patches\` the dep between gmp and webp just doesn't sit right with me.
Review

The file in itself is ~270 lines - would you rather it be on it's own ir in a patch file? Can do either.

File: https://github.com/gcc-mirror/gcc/blob/master/ar-lib

The file in itself is ~270 lines - would you rather it be on it's own ir in a patch file? Can do either. File: https://github.com/gcc-mirror/gcc/blob/master/ar-lib
Review

If its a fixed URI, we could just grab it in setup_msys2.cmake and place it in a convenient location (ie somewhere the msys2 tree) for all deps to use if they need it.

If its a fixed URI, we could just grab it in `setup_msys2.cmake` and place it in a convenient location (ie somewhere the msys2 tree) for all deps to use if they need it.
Review

Sure, will grap a specific version like I do with gas-preprocessor

Sure, will grap a specific version like I do with gas-preprocessor
set(arlib_joint_path "${arlib_path} lib.exe")
set(arlib_joint_path "ar-lib lib.exe")
set(GMP_CFLAGS "-nologo -W3 -utf-8 -MP -MD -Z7 -Ob0 -Od -Xcompiler -RTC1 -DWIN32 -D_WINDOWS")
set(GMP_CC_CXX "${compilescript_path} cl")
set(GMP_NM "dumpbin.exe -symbols -headers")
@ -60,14 +58,6 @@ ExternalProject_Add(external_gmp
INSTALL_DIR ${LIBDIR}/gmp
)
if(MSVC)
# This is in order to use the version of ar-lib that comes with webp
add_dependencies(
external_gmp
external_webp
)
endif()
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_gmp after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/gmp/bin/gmp-10.dll ${HARVEST_TARGET}/gmp/lib/gmp-10.dll

View File

@ -67,7 +67,7 @@ execute_process(
message("Installing required packages")
execute_process(
COMMAND ${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd -defterm -no-start -clang64 -c "pacman -S patch m4 coreutils nasm pkgconf make diffutils autoconf-wrapper --noconfirm && exit"
COMMAND ${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd -defterm -no-start -clang64 -c "pacman -S patch m4 coreutils pkgconf make diffutils autoconf-wrapper --noconfirm && exit"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/msys2/msys64
)
@ -87,6 +87,23 @@ if(EXISTS "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/link.exe")
)
endif()
message("Checking for nasm")
if(NOT EXISTS "${DOWNLOAD_DIR}/nasm-2.13.02-win64.zip")
message("Downloading nasm")
file(DOWNLOAD "http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/win64/nasm-2.13.02-win64.zip" "${DOWNLOAD_DIR}/nasm-2.13.02-win64.zip")
endif()
# extract nasm
if((NOT EXISTS "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/nasm.exe") AND (EXISTS "${DOWNLOAD_DIR}/nasm-2.13.02-win64.zip"))
message("Extracting nasm")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/nasm-2.13.02-win64.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/nasm-2.13.02/nasm.exe" "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/nasm.exe"
)
message("Checking for perl")
# download perl for libvpx
if(NOT EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip")
@ -119,6 +136,13 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/gas-preprocessor.pl")
file(DOWNLOAD "https://raw.githubusercontent.com/FFmpeg/gas-preprocessor/9309c67acb535ca6248f092e96131d8eb07eefc1/gas-preprocessor.pl" "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/gas-preprocessor.pl")
endif()
# Get ar-lib
message("Checking for ar-lib")
if(NOT EXISTS "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/ar-lib")
message("Downloading ar-lib")
file(DOWNLOAD "https://raw.githubusercontent.com/gcc-mirror/gcc/releases/gcc-12.2.0/ar-lib" "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/ar-lib")
endif()
if(NOT EXISTS "${DOWNLOAD_DIR}/msys2/msys64/ming64sh.cmd")
message("Installing ming64sh.cmd")
execute_process(