Fix CI and build system issues

- Update CMakeLists.txt version from 1.16.0 to 1.17.0 to match current release
- Fix macOS CI script to use 'sysctl -n hw.ncpu' instead of Linux 'nproc' command
- Modernize Windows CI Python paths from outdated Python 3.4/3.7 to Python 3.12

These changes ensure build consistency across platforms and update to supported Python versions.
This commit is contained in:
ChaiAndCode 2025-09-20 17:30:26 +08:00
parent 403604dfc7
commit 85d319717b
3 changed files with 8 additions and 8 deletions

View File

@ -4,7 +4,7 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(googletest-distribution) project(googletest-distribution)
set(GOOGLETEST_VERSION 1.16.0) set(GOOGLETEST_VERSION 1.17.0)
if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)

View File

@ -49,8 +49,8 @@ for cmake_off_on in OFF ON; do
-Dgmock_build_tests=ON \ -Dgmock_build_tests=ON \
-Dcxx_no_exception=${cmake_off_on} \ -Dcxx_no_exception=${cmake_off_on} \
-Dcxx_no_rtti=${cmake_off_on} -Dcxx_no_rtti=${cmake_off_on}
time make -j$(nproc) time make -j$(sysctl -n hw.ncpu)
time ctest -j$(nproc) --output-on-failure time ctest -j$(sysctl -n hw.ncpu) --output-on-failure
done done
# Test the Bazel build # Test the Bazel build

View File

@ -2,8 +2,8 @@ SETLOCAL ENABLEDELAYEDEXPANSION
SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-8.2.1-windows-x86_64.exe SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-8.2.1-windows-x86_64.exe
SET PATH=C:\Python34;%PATH% SET PATH=C:\Python312;%PATH%
SET BAZEL_PYTHON=C:\python34\python.exe SET BAZEL_PYTHON=C:\python312\python.exe
SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe
SET CMAKE_BIN="cmake.exe" SET CMAKE_BIN="cmake.exe"
SET CTEST_BIN="ctest.exe" SET CTEST_BIN="ctest.exe"
@ -23,9 +23,9 @@ CD %CMAKE_BUILD_PATH%
%CMAKE_BIN% %GTEST_ROOT% ^ %CMAKE_BIN% %GTEST_ROOT% ^
-G "Visual Studio 17 2022" ^ -G "Visual Studio 17 2022" ^
-DCMAKE_CXX_STANDARD=17 ^ -DCMAKE_CXX_STANDARD=17 ^
-DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^ -DPYTHON_EXECUTABLE:FILEPATH=c:\python312\python.exe ^
-DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^ -DPYTHON_INCLUDE_DIR:PATH=c:\python312\include ^
-DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^ -DPYTHON_LIBRARY:FILEPATH=c:\python312\lib\site-packages\pip ^
-Dgtest_build_samples=ON ^ -Dgtest_build_samples=ON ^
-Dgtest_build_tests=ON ^ -Dgtest_build_tests=ON ^
-Dgmock_build_tests=ON -Dgmock_build_tests=ON