Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit support for MSVC_VERSION_REQUIRED in release-tools #911

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions jenkins-scripts/lib/windows_env_vars.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
:: legacy option was to use MSVC19 by default with no configuration
if NOT DEFINED MSVC_VERSION_REQUIRED (
set MSVC_VERSION_REQUIRED=2019
)

if exist D:\vcpkg (
set VCPKG_DIR=D:\vcpkg
) else if exist C:\vcpkg (
Expand Down
42 changes: 29 additions & 13 deletions jenkins-scripts/lib/windows_library.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ IF %PLATFORM_TO_BUILD% == x86 (

echo "Configure the VC++ compilation"
set MSVC22_ON_WIN32_C=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat
:: 2019 versions
:: 2019 versions
set MSVC_ON_WIN64_E=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
set MSVC_ON_WIN32_E=C:\Program Files\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
set MSVC_ON_WIN64_C=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat
Expand All @@ -48,19 +48,35 @@ set LIB_DIR="%~dp0"
call %LIB_DIR%\windows_env_vars.bat
set PATH=%PATH%;%VCPKG_DIR%\installed\%VCPKG_DEFAULT_TRIPLET%\bin

IF exist "%MSVC22_ON_WIN32_C%" (
call "%MSVC22_ON_WIN32_C%" %MSVC_KEYWORD% || goto %win_lib% :error
) ELSE IF exist "%MSVC_ON_WIN64_E%" (
call "%MSVC_ON_WIN64_E%" %MSVC_KEYWORD% || goto %win_lib% :error
) ELSE IF exist "%MSVC_ON_WIN32_E%" (
call "%MSVC_ON_WIN32_E%" %MSVC_KEYWORD% || goto %win_lib% :error
) ELSE IF exist "%MSVC_ON_WIN64_C%" (
call "%MSVC_ON_WIN64_C%" %MSVC_KEYWORD% || goto %win_lib% :error
) ELSE IF exist "%MSVC_ON_WIN32_C%" (
call "%MSVC_ON_WIN32_C%" %MSVC_KEYWORD% || goto %win_lib% :error
:: Leave disabled until https://github.com/gazebo-tooling/release-tools/issues/910 is fix and MSVC2022
:: is being required by a version of Gazebo.
::
:: IF [%MSVC_VERSION_REQUIRED%] == [2022] (
:: IF exist "%MSVC22_ON_WIN32_C%" (
:: call "%MSVC22_ON_WIN32_C%" %MSVC_KEYWORD% || goto %win_lib% :error
:: ) ELSE (
:: :: TODO: implement other versions of MSVC 2022 if needed
:: echo "Not found a valid version of 2022 MSVC. Only Community is supported"
:: exit 1
:: )
:: ) ELSE

IF [%MSVC_VERSION_REQUIRED%] == [2019] (
IF exist "%MSVC_ON_WIN64_E%" (
call "%MSVC_ON_WIN64_E%" %MSVC_KEYWORD% || goto %win_lib% :error
) ELSE IF exist "%MSVC_ON_WIN32_E%" (
call "%MSVC_ON_WIN32_E%" %MSVC_KEYWORD% || goto %win_lib% :error
) ELSE IF exist "%MSVC_ON_WIN64_C%" (
call "%MSVC_ON_WIN64_C%" %MSVC_KEYWORD% || goto %win_lib% :error
) ELSE IF exist "%MSVC_ON_WIN32_C%" (
call "%MSVC_ON_WIN32_C%" %MSVC_KEYWORD% || goto %win_lib% :error
) ELSE (
echo "Not found a valid version of the MSVC19 vcvarsall file"
exit 1
)
) ELSE (
echo "Could not find the vcvarsall.bat file"
exit -1
echo "MSVC_VERSION_REQUIRED variable not found. This is a bug"
exit 1
)

goto :EOF
Expand Down