From 85d319717ba06f5ca848be27c92359dfcc4ba8e8 Mon Sep 17 00:00:00 2001 From: ChaiAndCode Date: Sat, 20 Sep 2025 17:30:26 +0800 Subject: [PATCH] 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. --- CMakeLists.txt | 2 +- ci/macos-presubmit.sh | 4 ++-- ci/windows-presubmit.bat | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c784f3c7c..0567ae7da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.16) 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) set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/ci/macos-presubmit.sh b/ci/macos-presubmit.sh index 63cf81484..b1e520738 100644 --- a/ci/macos-presubmit.sh +++ b/ci/macos-presubmit.sh @@ -49,8 +49,8 @@ for cmake_off_on in OFF ON; do -Dgmock_build_tests=ON \ -Dcxx_no_exception=${cmake_off_on} \ -Dcxx_no_rtti=${cmake_off_on} - time make -j$(nproc) - time ctest -j$(nproc) --output-on-failure + time make -j$(sysctl -n hw.ncpu) + time ctest -j$(sysctl -n hw.ncpu) --output-on-failure done # Test the Bazel build diff --git a/ci/windows-presubmit.bat b/ci/windows-presubmit.bat index 267e2e97f..a2f031528 100644 --- a/ci/windows-presubmit.bat +++ b/ci/windows-presubmit.bat @@ -2,8 +2,8 @@ SETLOCAL ENABLEDELAYEDEXPANSION SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-8.2.1-windows-x86_64.exe -SET PATH=C:\Python34;%PATH% -SET BAZEL_PYTHON=C:\python34\python.exe +SET PATH=C:\Python312;%PATH% +SET BAZEL_PYTHON=C:\python312\python.exe SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe SET CMAKE_BIN="cmake.exe" SET CTEST_BIN="ctest.exe" @@ -23,9 +23,9 @@ CD %CMAKE_BUILD_PATH% %CMAKE_BIN% %GTEST_ROOT% ^ -G "Visual Studio 17 2022" ^ -DCMAKE_CXX_STANDARD=17 ^ - -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^ - -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^ - -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^ + -DPYTHON_EXECUTABLE:FILEPATH=c:\python312\python.exe ^ + -DPYTHON_INCLUDE_DIR:PATH=c:\python312\include ^ + -DPYTHON_LIBRARY:FILEPATH=c:\python312\lib\site-packages\pip ^ -Dgtest_build_samples=ON ^ -Dgtest_build_tests=ON ^ -Dgmock_build_tests=ON