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

Fix the pipeline breaks dues to the MSVC 19.40 and numpy 2.0 release #747

Merged
merged 13 commits into from
Jun 17, 2024
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0077 NEW)
endif()

# Avoid warning of Calling FetchContent_Populate(GSL) is deprecated
wenbingl marked this conversation as resolved.
Show resolved Hide resolved
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30.0")
cmake_policy(CMP0169 OLD)
endif()

# Needed for Java
set(CMAKE_C_STANDARD 99)

Expand Down
11 changes: 8 additions & 3 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION

IF NOT EXIST "%ProgramFiles%\CMake\bin\cmake.exe" GOTO :FIND_VS
set cmake_exe="%ProgramFiles%\CMake\bin\cmake.exe"

:FIND_VS
IF DEFINED VSINSTALLDIR GOTO :VSDEV_CMD
set _VSFINDER=%~dp0tools\get_vsdevcmd.ps1
for /f "tokens=* USEBACKQ" %%i in (
`powershell -NoProfile -ExecutionPolicy Bypass -File "%_VSFINDER%"`) do call "%%i"

IF NOT DEFINED VSINSTALLDIR GOTO :NOT_FOUND

IF "%1" == "-A" GOTO :VSDEV_CMD
set GEN_PLATFORM=-A x64
IF DEFINED cmake_exe GOTO :VSDEV_CMD
set cmake_exe="%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"

:VSDEV_CMD
set GENERATOR="Visual Studio 16 2019"
IF "%VisualStudioVersion:~0,2%" == "16" GOTO :START_BUILD
set GENERATOR="Visual Studio 17 2022"

:START_BUILD
REM set cmake_exe="%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
set cmake_exe="cmake"
mkdir .\out\Windows\ 2>NUL
ECHO %cmake_exe% -G %GENERATOR% %GEN_PLATFORM% %* -B out\Windows -S .
%cmake_exe% -G %GENERATOR% %GEN_PLATFORM% %* -B out\Windows -S .
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
%cmake_exe% --build out\Windows --config RelWithDebInfo
Expand Down
Loading