From 10484181dc150a6c3a1f8cb05386d9691f9b431b Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 5 Sep 2024 07:16:57 -0700 Subject: [PATCH 01/59] bump macos version --- .github/workflows/build-ios-mac.yml | 42 +++++++++++++++++++++++++++ .github/workflows/build-ios-mac11.yml | 35 ---------------------- 2 files changed, 42 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/build-ios-mac.yml delete mode 100644 .github/workflows/build-ios-mac11.yml diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml new file mode 100644 index 000000000..287838b0c --- /dev/null +++ b/.github/workflows/build-ios-mac.yml @@ -0,0 +1,42 @@ +name: C/C++ CI for iOS + +on: + push: + branches: + - master + - main + - dev + - dev/* + - release/* + - buildme/* + + pull_request: + branches: + - master + - main + - dev + + schedule: + - cron: 0 2 * * 1-5 + +jobs: + build: + strategy: + matrix: + os: [macos-11, macos-14] + config: [release, debug] + simulator: ["'iPhone 8'", "'iPad Air (3rd generation)'"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + continue-on-error: true + - name: build + run: | + if [[ "${{ matrix.os }}" == "macos-11" ]]; then + export IOS_DEPLOYMENT_TARGET=11.0; + elif [[ "${{ matrix.os }}" == "macos-14" ]]; then + export IOS_DEPLOYMENT_TARGET=14.0; + fi + ./build-tests-ios.sh ${{ matrix.config }} ${{ matrix.simulator }} diff --git a/.github/workflows/build-ios-mac11.yml b/.github/workflows/build-ios-mac11.yml deleted file mode 100644 index 9c60f195a..000000000 --- a/.github/workflows/build-ios-mac11.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: C/C++ CI for iOS - -on: - push: - branches: - - master - - main - - dev - - dev/* - - release/* - - buildme/* - - pull_request: - branches: - - master - - main - - dev - - schedule: - - cron: 0 2 * * 1-5 - -jobs: - build: - runs-on: macOS-11 - strategy: - matrix: - config: [release, debug] - simulator: ["'iPhone 8'", "'iPad Air (3rd generation)'"] - steps: - - uses: actions/checkout@v2 - with: - submodules: 'true' - continue-on-error: true - - name: build - run: export IOS_DEPLOYMENT_TARGET=11.0 && ./build-tests-ios.sh ${{ matrix.config }} ${{ matrix.simulator }} From 10a2697cbdacedbab75067ad5448c7fa9ccfb22d Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 5 Sep 2024 07:38:37 -0700 Subject: [PATCH 02/59] incorrect version --- .github/workflows/build-ios-mac.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index 287838b0c..435c0ba0e 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -23,7 +23,7 @@ jobs: build: strategy: matrix: - os: [macos-11, macos-14] + os: [macos-12, macos-14] config: [release, debug] simulator: ["'iPhone 8'", "'iPad Air (3rd generation)'"] runs-on: ${{ matrix.os }} @@ -34,8 +34,8 @@ jobs: continue-on-error: true - name: build run: | - if [[ "${{ matrix.os }}" == "macos-11" ]]; then - export IOS_DEPLOYMENT_TARGET=11.0; + if [[ "${{ matrix.os }}" == "macos-12" ]]; then + export IOS_DEPLOYMENT_TARGET=12.0; elif [[ "${{ matrix.os }}" == "macos-14" ]]; then export IOS_DEPLOYMENT_TARGET=14.0; fi From cb4d84df0480351748477d5ee088d70fa7095cc8 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 5 Sep 2024 08:49:05 -0700 Subject: [PATCH 03/59] check install prefix access --- CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 285b8146d..bd1f2468d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,23 @@ cmake_minimum_required(VERSION 3.1.0) project(MSTelemetry) +# Set installation prefix for macOS and Linux +if(UNIX AND NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation directory prefix" FORCE) +endif() + +# Check write access to prefix, fallback to user's home directory if needed (Unix only) +if(UNIX) + file(WRITE "${CMAKE_INSTALL_PREFIX}/.cmake_write_test" "") + if("${CMAKE_STATUS}" STREQUAL "0") + message(STATUS "Write access to ${CMAKE_INSTALL_PREFIX} confirmed.") + file(REMOVE "${CMAKE_INSTALL_PREFIX}/.cmake_write_test") + else() + set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/mst_telemetry" CACHE PATH "Fallback installation directory prefix" FORCE) + message(STATUS "No write access to ${CMAKE_INSTALL_PREFIX}, installing to $HOME/mst_telemetry instead.") + endif() +endif() + set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers") From db048cf98f51fd3feffb88c160a006945ed449d1 Mon Sep 17 00:00:00 2001 From: Lalit Bhasin Date: Tue, 21 Jan 2025 15:25:06 -0800 Subject: [PATCH 04/59] fix the cmake to not exit if the write test fail --- CMakeLists.txt | 9 +++++---- build-tests-ios.sh | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd1f2468d..387d6bb72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,12 +6,13 @@ if(UNIX AND NOT DEFINED CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation directory prefix" FORCE) endif() -# Check write access to prefix, fallback to user's home directory if needed (Unix only) if(UNIX) - file(WRITE "${CMAKE_INSTALL_PREFIX}/.cmake_write_test" "") - if("${CMAKE_STATUS}" STREQUAL "0") + # Test write access to CMAKE_INSTALL_PREFIX + set(TEST_FILE "${CMAKE_INSTALL_PREFIX}/.cmake_write_test") + file(WRITE "${TEST_FILE}" "") # Attempt to write the test file + if(EXISTS "${TEST_FILE}") message(STATUS "Write access to ${CMAKE_INSTALL_PREFIX} confirmed.") - file(REMOVE "${CMAKE_INSTALL_PREFIX}/.cmake_write_test") + file(REMOVE "${TEST_FILE}") # Cleanup the test file else() set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/mst_telemetry" CACHE PATH "Fallback installation directory prefix" FORCE) message(STATUS "No write access to ${CMAKE_INSTALL_PREFIX}, installing to $HOME/mst_telemetry instead.") diff --git a/build-tests-ios.sh b/build-tests-ios.sh index fb48b4ea7..d0f7d428d 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -1,4 +1,7 @@ #!/bin/sh +// Add current user +current_user=`id` +echo "CURRENT USER:" $current_user cd ${0%/*} SKU=${1:-release} SIMULATOR=${2:-iPhone 8} From 4e7e8cc473f570bffbef5b69b733860b6d69d4b9 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 21 Jan 2025 15:29:17 -0800 Subject: [PATCH 05/59] macos12 is deprecated. switch to macos13 and macos15 --- .github/workflows/build-ios-mac.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index 435c0ba0e..84b47523a 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -23,7 +23,7 @@ jobs: build: strategy: matrix: - os: [macos-12, macos-14] + os: [macos-13, macos-15] config: [release, debug] simulator: ["'iPhone 8'", "'iPad Air (3rd generation)'"] runs-on: ${{ matrix.os }} @@ -34,9 +34,9 @@ jobs: continue-on-error: true - name: build run: | - if [[ "${{ matrix.os }}" == "macos-12" ]]; then - export IOS_DEPLOYMENT_TARGET=12.0; - elif [[ "${{ matrix.os }}" == "macos-14" ]]; then - export IOS_DEPLOYMENT_TARGET=14.0; + if [[ "${{ matrix.os }}" == "macos-13" ]]; then + export IOS_DEPLOYMENT_TARGET=13.0; + elif [[ "${{ matrix.os }}" == "macos-15" ]]; then + export IOS_DEPLOYMENT_TARGET=15.0; fi ./build-tests-ios.sh ${{ matrix.config }} ${{ matrix.simulator }} From 7dac26ff9d46e14ca4538e14838c0b4e3ebecd06 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 21 Jan 2025 15:39:51 -0800 Subject: [PATCH 06/59] try to gracefully fail for write --- CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 387d6bb72..e4b1eaf0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,19 +6,25 @@ if(UNIX AND NOT DEFINED CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation directory prefix" FORCE) endif() + if(UNIX) - # Test write access to CMAKE_INSTALL_PREFIX set(TEST_FILE "${CMAKE_INSTALL_PREFIX}/.cmake_write_test") - file(WRITE "${TEST_FILE}" "") # Attempt to write the test file + + # Attempt to write a test file + file(WRITE "${TEST_FILE}" "" OUTPUT_VARIABLE WRITE_RESULT ERROR_VARIABLE WRITE_ERROR) + if(EXISTS "${TEST_FILE}") message(STATUS "Write access to ${CMAKE_INSTALL_PREFIX} confirmed.") - file(REMOVE "${TEST_FILE}") # Cleanup the test file + file(REMOVE "${TEST_FILE}") # Clean up the test file else() + # Fallback to a writable directory (e.g., user's home) set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/mst_telemetry" CACHE PATH "Fallback installation directory prefix" FORCE) - message(STATUS "No write access to ${CMAKE_INSTALL_PREFIX}, installing to $HOME/mst_telemetry instead.") + message(STATUS "No write access to ${CMAKE_INSTALL_PREFIX}, using $ENV{HOME}/mst_telemetry instead.") endif() endif() + + set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers") From 0c7ff51b3f40547109da04324c50e7659bca9554 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 21 Jan 2025 16:00:13 -0800 Subject: [PATCH 07/59] more cleaner check --- CMakeLists.txt | 49 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4b1eaf0a..ffd86c57a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,20 +7,41 @@ if(UNIX AND NOT DEFINED CMAKE_INSTALL_PREFIX) endif() -if(UNIX) - set(TEST_FILE "${CMAKE_INSTALL_PREFIX}/.cmake_write_test") - - # Attempt to write a test file - file(WRITE "${TEST_FILE}" "" OUTPUT_VARIABLE WRITE_RESULT ERROR_VARIABLE WRITE_ERROR) - - if(EXISTS "${TEST_FILE}") - message(STATUS "Write access to ${CMAKE_INSTALL_PREFIX} confirmed.") - file(REMOVE "${TEST_FILE}") # Clean up the test file - else() - # Fallback to a writable directory (e.g., user's home) - set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/mst_telemetry" CACHE PATH "Fallback installation directory prefix" FORCE) - message(STATUS "No write access to ${CMAKE_INSTALL_PREFIX}, using $ENV{HOME}/mst_telemetry instead.") - endif() +# Set installation prefix for Unix systems (macOS and Linux) +if(UNIX AND NOT DEFINED CMAKE_INSTALL_PREFIX) + # First try /usr/local + set(TEST_FILE "/usr/local/.ci_write_test") + + # Try to create a test file + execute_process( + COMMAND ${CMAKE_COMMAND} -E touch "${TEST_FILE}" + RESULT_VARIABLE WRITE_RESULT + ) + + # Check if write was successful + if(WRITE_RESULT EQUAL 0) + # We have write access to /usr/local + set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation directory prefix" FORCE) + message(STATUS "Using /usr/local as installation prefix (write access confirmed)") + # Clean up test file + execute_process(COMMAND ${CMAKE_COMMAND} -E remove "${TEST_FILE}") + else() + # No write access, fall back to HOME directory + set(FALLBACK_DIR "$ENV{HOME}/mst_telemetry") + + # Create the mst_telemetry directory + execute_process( + COMMAND ${CMAKE_COMMAND} -E make_directory "${FALLBACK_DIR}" + RESULT_VARIABLE CREATE_DIR_RESULT + ) + + if(NOT CREATE_DIR_RESULT EQUAL 0) + message(FATAL_ERROR "Failed to create directory: ${FALLBACK_DIR}") + endif() + + set(CMAKE_INSTALL_PREFIX "${FALLBACK_DIR}" CACHE PATH "Installation directory prefix" FORCE) + message(STATUS "No write access to /usr/local, created and using ${FALLBACK_DIR} instead") + endif() endif() From c058ef3f907aa7086ffc03c56957c4056540b5aa Mon Sep 17 00:00:00 2001 From: Lalit Date: Tue, 21 Jan 2025 22:17:01 -0800 Subject: [PATCH 08/59] update ci yaml --- .github/workflows/build-ios-mac.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index 84b47523a..a4b2d56fc 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -28,6 +28,9 @@ jobs: simulator: ["'iPhone 8'", "'iPad Air (3rd generation)'"] runs-on: ${{ matrix.os }} steps: + - name: Grant write permissions to /usr/local + run: | + sudo chown -R $USER:staff /usr/local - uses: actions/checkout@v2 with: submodules: 'true' From a500fcbf8e73efcaa5e135089cca7f33ec97084b Mon Sep 17 00:00:00 2001 From: Lalit Date: Tue, 21 Jan 2025 22:30:41 -0800 Subject: [PATCH 09/59] update the simulators --- .github/workflows/build-ios-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index a4b2d56fc..dc517651e 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -25,7 +25,7 @@ jobs: matrix: os: [macos-13, macos-15] config: [release, debug] - simulator: ["'iPhone 8'", "'iPad Air (3rd generation)'"] + simulator: ["'iPhone 15'", "'iPad Air 11-inch (M2)'"] runs-on: ${{ matrix.os }} steps: - name: Grant write permissions to /usr/local From 72bf84aca452b3c7b30518538ed522218913ad5f Mon Sep 17 00:00:00 2001 From: Lalit Date: Tue, 21 Jan 2025 22:50:26 -0800 Subject: [PATCH 10/59] use iphone 16 as simulator --- .github/workflows/build-ios-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index dc517651e..dae79812d 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -25,7 +25,7 @@ jobs: matrix: os: [macos-13, macos-15] config: [release, debug] - simulator: ["'iPhone 15'", "'iPad Air 11-inch (M2)'"] + simulator: ["'iPhone 16'", "'iPad Air 11-inch (M2)'"] runs-on: ${{ matrix.os }} steps: - name: Grant write permissions to /usr/local From 2c4f2ba7adc4e97720f2416c6c7bf5be561d79e6 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Thu, 6 Feb 2025 15:49:12 -0800 Subject: [PATCH 11/59] Add debug code to build-gtest.sh --- build-gtest.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-gtest.sh b/build-gtest.sh index c92c0f2dc..e4762245c 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -15,6 +15,8 @@ else fi cd `dirname $0` +pwd +ls third_party GTEST_PATH=third_party/googletest if [ ! "$(ls -A $GTEST_PATH/CMakeLists.txt)" ]; then echo Clone googletest from google/googletest:master ... From 3c7d85bf159b30fd3ebedea7e7cce2893e881a76 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Thu, 6 Feb 2025 16:03:54 -0800 Subject: [PATCH 12/59] Add more log --- build-gtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-gtest.sh b/build-gtest.sh index e4762245c..4029695e8 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -16,7 +16,7 @@ fi cd `dirname $0` pwd -ls third_party +ls third_party/googletest GTEST_PATH=third_party/googletest if [ ! "$(ls -A $GTEST_PATH/CMakeLists.txt)" ]; then echo Clone googletest from google/googletest:master ... From da2986ba73a712cdb6351078ca52368f2574c393 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Thu, 6 Feb 2025 16:15:52 -0800 Subject: [PATCH 13/59] Update checkout action --- .github/workflows/build-ios-mac11.yml | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/build-ios-mac11.yml diff --git a/.github/workflows/build-ios-mac11.yml b/.github/workflows/build-ios-mac11.yml new file mode 100644 index 000000000..c7a23f861 --- /dev/null +++ b/.github/workflows/build-ios-mac11.yml @@ -0,0 +1,36 @@ +name: C/C++ CI for iOS + +on: + push: + branches: + - master + - main + - dev + - dev/* + - release/* + - buildme/* + + pull_request: + branches: + - master + - main + - dev + + schedule: + - cron: 0 2 * * 1-5 + +jobs: + build: + runs-on: macOS-11 + strategy: + matrix: + config: [release, debug] + simulator: ["'iPhone 8'", "'iPad Air (3rd generation)'"] + steps: + - uses: actions/checkout@v4 + with: + submodules: 'true' + fetch-depth: 1 + continue-on-error: true + - name: build + run: export IOS_DEPLOYMENT_TARGET=11.0 && ./build-tests-ios.sh ${{ matrix.config }} ${{ matrix.simulator }} From 200632aecadf5a5e2ee059175e969c5945cca6a0 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Thu, 6 Feb 2025 16:23:08 -0800 Subject: [PATCH 14/59] Fix checkout submodules --- .github/workflows/build-ios-mac11.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ios-mac11.yml b/.github/workflows/build-ios-mac11.yml index c7a23f861..2bcb16875 100644 --- a/.github/workflows/build-ios-mac11.yml +++ b/.github/workflows/build-ios-mac11.yml @@ -29,7 +29,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: 'true' + submodules: true fetch-depth: 1 continue-on-error: true - name: build From f6bd624066e0e14e5bacaaaa3c60355c482d8abf Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 10:05:50 -0800 Subject: [PATCH 15/59] Fix build variable name --- build-gtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-gtest.sh b/build-gtest.sh index 4029695e8..32683ec8f 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -29,7 +29,7 @@ fi echo "Add ios and arm64 build steps for googletest" cat > $GTEST_PATH/CMakeLists_temp.txt << EOF # If building for iOS, set all the iOS options -if(BUILD_IOS) +if(IOS_BUILD) set(TARGET_ARCH "APPLE") set(IOS True) set(APPLE True) From ff8f3ad3e0bbed0262d7e3bbaf5119f44f452c2e Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 10:19:47 -0800 Subject: [PATCH 16/59] Add more log --- build-gtest.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-gtest.sh b/build-gtest.sh index 32683ec8f..a2b4ce6b4 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -29,7 +29,8 @@ fi echo "Add ios and arm64 build steps for googletest" cat > $GTEST_PATH/CMakeLists_temp.txt << EOF # If building for iOS, set all the iOS options -if(IOS_BUILD) +if(BUILD_IOS) + message("-- Building for iOS simulator") set(TARGET_ARCH "APPLE") set(IOS True) set(APPLE True) From 2c5d7402889677a551c015fadd609e1e65cac588 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 12:02:20 -0800 Subject: [PATCH 17/59] Set architecture --- build-gtest.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-gtest.sh b/build-gtest.sh index a2b4ce6b4..b36b6e598 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -30,7 +30,7 @@ echo "Add ios and arm64 build steps for googletest" cat > $GTEST_PATH/CMakeLists_temp.txt << EOF # If building for iOS, set all the iOS options if(BUILD_IOS) - message("-- Building for iOS simulator") + message("-- Building for iOS simulator..") set(TARGET_ARCH "APPLE") set(IOS True) set(APPLE True) @@ -44,6 +44,8 @@ if(BUILD_IOS) ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) message("-- CMAKE_OSX_SYSROOT \${CMAKE_OSX_SYSROOT}") + message("-- CMAKE_OSX_ARCHITECTURES \${CMAKE_OSX_ARCHITECTURES}") + set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Architectures for iOS device") elseif(\${ARCH} STREQUAL "arm64") set(CMAKE_C_FLAGS "\${CMAKE_C_FLAGS} -arch arm64") set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -arch arm64") From 472903771bef84c73d47684b440e1d835ce1780f Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 12:10:48 -0800 Subject: [PATCH 18/59] Set one more flag --- build-gtest.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-gtest.sh b/build-gtest.sh index b36b6e598..b17dcca6a 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -46,6 +46,7 @@ if(BUILD_IOS) message("-- CMAKE_OSX_SYSROOT \${CMAKE_OSX_SYSROOT}") message("-- CMAKE_OSX_ARCHITECTURES \${CMAKE_OSX_ARCHITECTURES}") set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Architectures for iOS device") + set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO") elseif(\${ARCH} STREQUAL "arm64") set(CMAKE_C_FLAGS "\${CMAKE_C_FLAGS} -arch arm64") set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -arch arm64") From 655fa478775b95978f2ec1dc1f5939369a240515 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 12:13:15 -0800 Subject: [PATCH 19/59] Dump the arch of gtest library --- build-gtest.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-gtest.sh b/build-gtest.sh index b17dcca6a..62673e790 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -73,6 +73,9 @@ cmake -Dgtest_build_samples=OFF \ -DARCH=$ARCH \ .. make + +echo 'lipo /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a' +lipo /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a popd # CTEST_OUTPUT_ON_FAILURE=1 make test # make install From c7c5b8345be34ecf3544d980a086abf302852248 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 12:42:17 -0800 Subject: [PATCH 20/59] Add optin for lipo --- build-gtest.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-gtest.sh b/build-gtest.sh index 62673e790..d07e7cd68 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -74,8 +74,7 @@ cmake -Dgtest_build_samples=OFF \ .. make -echo 'lipo /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a' -lipo /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a +lipo -info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a popd # CTEST_OUTPUT_ON_FAILURE=1 make test # make install From 7a1b68e7eff2c6f748be4a30bb087310a47887a2 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 14:15:14 -0800 Subject: [PATCH 21/59] Log test target --- build-tests-ios.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-tests-ios.sh b/build-tests-ios.sh index d0f7d428d..58a9624e6 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -9,6 +9,8 @@ SIMULATOR=${2:-iPhone 8} set -e ./build-ios.sh ${SKU} +lipo -info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a + cd tests/unittests xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" From cc036d28d06e9292cea1b6e33100d195396d192f Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 14:22:05 -0800 Subject: [PATCH 22/59] Add build entry/exit log --- build-tests-ios.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-tests-ios.sh b/build-tests-ios.sh index 58a9624e6..6ce8e0785 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -7,7 +7,10 @@ SKU=${1:-release} SIMULATOR=${2:-iPhone 8} set -e + +echo "Building build-ios.sh" ./build-ios.sh ${SKU} +echo "End of build-ios.sh" lipo -info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a From 32326b8e447ac1efe0be9c8eac2f0d1af75c720c Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 14:27:33 -0800 Subject: [PATCH 23/59] Build for active arch only --- build-gtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-gtest.sh b/build-gtest.sh index d07e7cd68..270556014 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -46,7 +46,7 @@ if(BUILD_IOS) message("-- CMAKE_OSX_SYSROOT \${CMAKE_OSX_SYSROOT}") message("-- CMAKE_OSX_ARCHITECTURES \${CMAKE_OSX_ARCHITECTURES}") set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Architectures for iOS device") - set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO") + set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "YES") elseif(\${ARCH} STREQUAL "arm64") set(CMAKE_C_FLAGS "\${CMAKE_C_FLAGS} -arch arm64") set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -arch arm64") From 9e0ec42caa4cd3ce3eb6ecd3a388033f27b875fc Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 14:42:04 -0800 Subject: [PATCH 24/59] Log arch --- build-ios.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-ios.sh b/build-ios.sh index 1fc411a7c..d213e3958 100755 --- a/build-ios.sh +++ b/build-ios.sh @@ -25,6 +25,7 @@ elif [ "$1" == "debug" ]; then fi # Set Architecture: arm64, arm64e or x86_64 +/usr/bin/uname -a IOS_ARCH=$(/usr/bin/uname -m) if [ "$1" == "arm64" ]; then IOS_ARCH="arm64" From 0e814321a32c44d99615faf5093c2d361b9d994c Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 15:13:29 -0800 Subject: [PATCH 25/59] Check variable cache --- build-gtest.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build-gtest.sh b/build-gtest.sh index 270556014..b37401116 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -44,9 +44,12 @@ if(BUILD_IOS) ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) message("-- CMAKE_OSX_SYSROOT \${CMAKE_OSX_SYSROOT}") - message("-- CMAKE_OSX_ARCHITECTURES \${CMAKE_OSX_ARCHITECTURES}") - set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Architectures for iOS device") - set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "YES") +get_property(is_cached CACHE CMAKE_OSX_SYSROOT SET) + if(is_cached) + message(STATUS "CMAKE_OSX_SYSROOT is a cached variable.") + else() + message(STATUS "CMAKE_OSX_SYSROOT is NOT cached.") + endif() elseif(\${ARCH} STREQUAL "arm64") set(CMAKE_C_FLAGS "\${CMAKE_C_FLAGS} -arch arm64") set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -arch arm64") From f1d632141bd0af0067b82ee4ae55c545c20020d5 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 15:23:44 -0800 Subject: [PATCH 26/59] Make CMAKE_OSX_SYSROOT as cache variable --- build-gtest.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/build-gtest.sh b/build-gtest.sh index b37401116..2ee4c44d0 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -40,16 +40,11 @@ if(BUILD_IOS) set(IOS_PLATFORM "iphonesimulator") set(CMAKE_SYSTEM_PROCESSOR x86_64) execute_process(COMMAND xcodebuild -version -sdk \${IOS_PLATFORM} Path - OUTPUT_VARIABLE CMAKE_OSX_SYSROOT + OUTPUT_VARIABLE CMAKE_OSX_SYSROOT_OUT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) + set(CMAKE_OSX_SYSROOT \${CMAKE_OSX_SYSROOT_OUT} CACHE STRING "Force set of the sysroot for iOS" FORCE) message("-- CMAKE_OSX_SYSROOT \${CMAKE_OSX_SYSROOT}") -get_property(is_cached CACHE CMAKE_OSX_SYSROOT SET) - if(is_cached) - message(STATUS "CMAKE_OSX_SYSROOT is a cached variable.") - else() - message(STATUS "CMAKE_OSX_SYSROOT is NOT cached.") - endif() elseif(\${ARCH} STREQUAL "arm64") set(CMAKE_C_FLAGS "\${CMAKE_C_FLAGS} -arch arm64") set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -arch arm64") From 09c7c45bf47bcd25144f20a6c39e90f3052526d9 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 15:34:40 -0800 Subject: [PATCH 27/59] Add system name variable --- build-gtest.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-gtest.sh b/build-gtest.sh index 2ee4c44d0..94b696aa6 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -69,6 +69,7 @@ cmake -Dgtest_build_samples=OFF \ -DCMAKE_CXX_FLAGS="-fPIC $CXX_FLAGS" \ -DBUILD_IOS=$IOS_BUILD \ -DARCH=$ARCH \ + -DCMAKE_SYSTEM_NAME=iOS \ .. make From 1fc2392ffaa7b9cb5a8cf32c41d889a411b2c301 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 15:44:31 -0800 Subject: [PATCH 28/59] Add verbose log --- build-gtest.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-gtest.sh b/build-gtest.sh index 94b696aa6..ad4a7b702 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -69,9 +69,8 @@ cmake -Dgtest_build_samples=OFF \ -DCMAKE_CXX_FLAGS="-fPIC $CXX_FLAGS" \ -DBUILD_IOS=$IOS_BUILD \ -DARCH=$ARCH \ - -DCMAKE_SYSTEM_NAME=iOS \ .. -make +make VERBOSE=1 lipo -info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a popd From b5e47d9b4aab3c4a72d90bbb24433b4618234c36 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 16:10:03 -0800 Subject: [PATCH 29/59] Add verbose log to xcode --- build-tests-ios.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tests-ios.sh b/build-tests-ios.sh index 6ce8e0785..ff6f94605 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -15,7 +15,7 @@ echo "End of build-ios.sh" lipo -info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a cd tests/unittests -xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" +xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" -quiet NO cd ../functests -xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,name=$SIMULATOR" +xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,name=$SIMULATOR" -quiet NO From 6f3dcfa168023caa0220707534709c6645a01882 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 16:12:23 -0800 Subject: [PATCH 30/59] Get dyld-info log --- build-gtest.sh | 2 +- build-tests-ios.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-gtest.sh b/build-gtest.sh index ad4a7b702..c5eeacf62 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -72,7 +72,7 @@ cmake -Dgtest_build_samples=OFF \ .. make VERBOSE=1 -lipo -info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a +dyld-info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a popd # CTEST_OUTPUT_ON_FAILURE=1 make test # make install diff --git a/build-tests-ios.sh b/build-tests-ios.sh index ff6f94605..ee4e21fb2 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -12,7 +12,7 @@ echo "Building build-ios.sh" ./build-ios.sh ${SKU} echo "End of build-ios.sh" -lipo -info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a +dyld-info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a cd tests/unittests xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" -quiet NO From ac75b72dce3afb6570df4c5b650fc7c7ae0d5be2 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 16:15:39 -0800 Subject: [PATCH 31/59] Add verbose log to xcode test --- build-tests-ios.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tests-ios.sh b/build-tests-ios.sh index ee4e21fb2..7eab45afc 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -15,7 +15,7 @@ echo "End of build-ios.sh" dyld-info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a cd tests/unittests -xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" -quiet NO +xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" -verbose cd ../functests -xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,name=$SIMULATOR" -quiet NO +xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,name=$SIMULATOR" -verbose From 44c01ee5dc17556c42ddb12a9eb617eed9f4adbe Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 16:52:09 -0800 Subject: [PATCH 32/59] Install cctools --- .github/workflows/build-ios-mac.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index dae79812d..fb75d1155 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -35,6 +35,9 @@ jobs: with: submodules: 'true' continue-on-error: true + - name: Install cctools + run: | + brew install cctools - name: build run: | if [[ "${{ matrix.os }}" == "macos-13" ]]; then From 37c4b95222a9675d8a6d5081a8602dee97748f8c Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 17:17:25 -0800 Subject: [PATCH 33/59] Fix dyldinfo path --- .github/workflows/build-ios-mac.yml | 3 --- build-gtest.sh | 2 +- build-tests-ios.sh | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index fb75d1155..dae79812d 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -35,9 +35,6 @@ jobs: with: submodules: 'true' continue-on-error: true - - name: Install cctools - run: | - brew install cctools - name: build run: | if [[ "${{ matrix.os }}" == "macos-13" ]]; then diff --git a/build-gtest.sh b/build-gtest.sh index c5eeacf62..a2fbdebe7 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -72,7 +72,7 @@ cmake -Dgtest_build_samples=OFF \ .. make VERBOSE=1 -dyld-info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a +dyldinfo /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a popd # CTEST_OUTPUT_ON_FAILURE=1 make test # make install diff --git a/build-tests-ios.sh b/build-tests-ios.sh index 7eab45afc..557a98b07 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -12,7 +12,7 @@ echo "Building build-ios.sh" ./build-ios.sh ${SKU} echo "End of build-ios.sh" -dyld-info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a +dyldinfo /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a cd tests/unittests xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" -verbose From b80465abc75a86e14084b95cfe544d736f719d07 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 17:47:38 -0800 Subject: [PATCH 34/59] Comment out dyndinfo --- build-gtest.sh | 2 +- build-tests-ios.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-gtest.sh b/build-gtest.sh index a2fbdebe7..81d8b1a8b 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -72,7 +72,7 @@ cmake -Dgtest_build_samples=OFF \ .. make VERBOSE=1 -dyldinfo /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a +# dyld-info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a popd # CTEST_OUTPUT_ON_FAILURE=1 make test # make install diff --git a/build-tests-ios.sh b/build-tests-ios.sh index 557a98b07..69d81be97 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -12,7 +12,7 @@ echo "Building build-ios.sh" ./build-ios.sh ${SKU} echo "End of build-ios.sh" -dyldinfo /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a +# dyld_info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a cd tests/unittests xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" -verbose From 56f17d79c9431171fa1f73ae8064e2a45645df8e Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 19:45:32 -0800 Subject: [PATCH 35/59] Add log of gtest path --- tests/unittests/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/unittests/CMakeLists.txt b/tests/unittests/CMakeLists.txt index 8edfca017..bd2d1a597 100644 --- a/tests/unittests/CMakeLists.txt +++ b/tests/unittests/CMakeLists.txt @@ -159,6 +159,9 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/../../third_party/googletest/build/lib/ ) + message("GTEST: ${LIBGTEST}") + message("GMOCK: ${LIBGMOCK}") + target_link_libraries(UnitTests ${LIBGTEST} ${LIBGMOCK} From af7ccfa5c07ef7f0e7032ed21a97b064b36e361d Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 20:15:50 -0800 Subject: [PATCH 36/59] Debug log --- tests/unittests/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unittests/CMakeLists.txt b/tests/unittests/CMakeLists.txt index bd2d1a597..160d33da5 100644 --- a/tests/unittests/CMakeLists.txt +++ b/tests/unittests/CMakeLists.txt @@ -147,6 +147,8 @@ else() include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/ ) + set(CMAKE_FIND_DEBUG_MODE 1) + find_file(LIBGTEST NAMES libgtest.a PATHS From fe5ae4ec2ee8ff5a59a38fdb7ab5a993b5d490f1 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 20:57:12 -0800 Subject: [PATCH 37/59] Set find mode --- tests/unittests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unittests/CMakeLists.txt b/tests/unittests/CMakeLists.txt index 160d33da5..e1a2dfc9a 100644 --- a/tests/unittests/CMakeLists.txt +++ b/tests/unittests/CMakeLists.txt @@ -148,6 +148,7 @@ else() include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/ ) set(CMAKE_FIND_DEBUG_MODE 1) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) find_file(LIBGTEST NAMES libgtest.a From 0f5aaabd52971e9279b17fef5e86196a6e32dae9 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 21:13:25 -0800 Subject: [PATCH 38/59] Set find mode for functests --- tests/functests/CMakeLists.txt | 2 ++ tests/unittests/CMakeLists.txt | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/functests/CMakeLists.txt b/tests/functests/CMakeLists.txt index 0a3b280a5..2551230c1 100644 --- a/tests/functests/CMakeLists.txt +++ b/tests/functests/CMakeLists.txt @@ -108,6 +108,8 @@ else() message("Current Dir: ${CMAKE_CURRENT_SOURCE_DIR}") message("Binary Dir: ${CMAKE_BINARY_DIR}") + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + find_file(LIBGTEST NAMES libgtest.a PATHS diff --git a/tests/unittests/CMakeLists.txt b/tests/unittests/CMakeLists.txt index e1a2dfc9a..df6e6a0e6 100644 --- a/tests/unittests/CMakeLists.txt +++ b/tests/unittests/CMakeLists.txt @@ -147,7 +147,6 @@ else() include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/ ) - set(CMAKE_FIND_DEBUG_MODE 1) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) find_file(LIBGTEST From d255b1930eee866c1d4e8caa69f6f4afba6dcbff Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 21:52:56 -0800 Subject: [PATCH 39/59] set target --- build-gtest.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build-gtest.sh b/build-gtest.sh index 81d8b1a8b..b91a8b84f 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -31,10 +31,14 @@ cat > $GTEST_PATH/CMakeLists_temp.txt << EOF # If building for iOS, set all the iOS options if(BUILD_IOS) message("-- Building for iOS simulator..") + message("-- CMAKE_OSX_DEPLOYMENT_TARGET \${CMAKE_OSX_DEPLOYMENT_TARGET}") + message("-- CMAKE_SYSTEM_NAME \${CMAKE_SYSTEM_NAME}") + message("-- CMAKE_OSX_ARCHITECTURES \${CMAKE_OSX_ARCHITECTURES}") set(TARGET_ARCH "APPLE") set(IOS True) set(APPLE True) - set(CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment target for iOS" FORCE) + set(CMAKE_SYSTEM_NAME iOS) + set(CMAKE_OSX_DEPLOYMENT_TARGET "12.2" CACHE STRING "Force set of the deployment target for iOS" FORCE) set(CMAKE_C_FLAGS "\${CMAKE_C_FLAGS} -miphoneos-version-min=10.0") set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -miphoneos-version-min=10.0 -std=c++11") set(IOS_PLATFORM "iphonesimulator") From caa3838cbbb3649cb7a4e1987c68bea5c150d1d4 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 22:02:24 -0800 Subject: [PATCH 40/59] Update IPHONEOS_DEPLOYMENT_TARGET --- tests/functests/functests-ios.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functests/functests-ios.xcodeproj/project.pbxproj b/tests/functests/functests-ios.xcodeproj/project.pbxproj index f1ebd5249..47fb2f22d 100644 --- a/tests/functests/functests-ios.xcodeproj/project.pbxproj +++ b/tests/functests/functests-ios.xcodeproj/project.pbxproj @@ -326,7 +326,7 @@ ../../third_party/googletest/googlemock/include/, ../common/, ); - IPHONEOS_DEPLOYMENT_TARGET = 11.2; + IPHONEOS_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = NO; @@ -389,7 +389,7 @@ ../../third_party/googletest/googlemock/include/, ../common/, ); - IPHONEOS_DEPLOYMENT_TARGET = 11.2; + IPHONEOS_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; From d7bfd26edb817b88dc638447bae274693aeb11b7 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 22:15:08 -0800 Subject: [PATCH 41/59] Add include path --- tests/functests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functests/CMakeLists.txt b/tests/functests/CMakeLists.txt index 2551230c1..887985ed6 100644 --- a/tests/functests/CMakeLists.txt +++ b/tests/functests/CMakeLists.txt @@ -63,7 +63,7 @@ if(PAL_IMPLEMENTATION STREQUAL "WIN32") message("--- WIN32: ... ${CMAKE_BINARY_DIR}/zlib") message("--- WIN32: ... ${CMAKE_BINARY_DIR}/sqlite") # link_directories(${CMAKE_BINARY_DIR}/gtest/ ${CMAKE_BINARY_DIR}/gmock/ ${CMAKE_BINARY_DIR}/zlib/ ${CMAKE_BINARY_DIR}/sqlite/) - include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../zlib ) + include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../zlib ${CMAKE_SOURCE_DIR}) target_link_libraries(FuncTests mat wininet.lib From 0a186454ec83a04fca94fd890a7dc14ad1a842ec Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 22:25:14 -0800 Subject: [PATCH 42/59] Fix include --- tests/functests/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/functests/CMakeLists.txt b/tests/functests/CMakeLists.txt index 887985ed6..d5395d1b7 100644 --- a/tests/functests/CMakeLists.txt +++ b/tests/functests/CMakeLists.txt @@ -49,6 +49,8 @@ endif() source_group(" " REGULAR_EXPRESSION "") source_group("common" REGULAR_EXPRESSION "/tests/common/") +include_directories( ${CMAKE_SOURCE_DIR} ) + if(BUILD_IOS) add_library(FuncTests ${SRCS} ${TESTS_COMMON_SRCS}) else() @@ -63,7 +65,7 @@ if(PAL_IMPLEMENTATION STREQUAL "WIN32") message("--- WIN32: ... ${CMAKE_BINARY_DIR}/zlib") message("--- WIN32: ... ${CMAKE_BINARY_DIR}/sqlite") # link_directories(${CMAKE_BINARY_DIR}/gtest/ ${CMAKE_BINARY_DIR}/gmock/ ${CMAKE_BINARY_DIR}/zlib/ ${CMAKE_BINARY_DIR}/sqlite/) - include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../zlib ${CMAKE_SOURCE_DIR}) + include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../zlib) target_link_libraries(FuncTests mat wininet.lib From 21ddfc2ad2a5f5e48ecae77610b491f0787c4e8d Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 22:53:07 -0800 Subject: [PATCH 43/59] Add functests log --- tests/functests/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/functests/CMakeLists.txt b/tests/functests/CMakeLists.txt index d5395d1b7..ccc080d01 100644 --- a/tests/functests/CMakeLists.txt +++ b/tests/functests/CMakeLists.txt @@ -49,6 +49,8 @@ endif() source_group(" " REGULAR_EXPRESSION "") source_group("common" REGULAR_EXPRESSION "/tests/common/") +message("-- functests: CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}") + include_directories( ${CMAKE_SOURCE_DIR} ) if(BUILD_IOS) From 97ff66a49a87ae25edd0ddf9081f6b6ccc407ff2 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 23:09:25 -0800 Subject: [PATCH 44/59] Add include dir to xcode project --- tests/functests/functests-ios.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/functests/functests-ios.xcodeproj/project.pbxproj b/tests/functests/functests-ios.xcodeproj/project.pbxproj index 47fb2f22d..e6d00eb35 100644 --- a/tests/functests/functests-ios.xcodeproj/project.pbxproj +++ b/tests/functests/functests-ios.xcodeproj/project.pbxproj @@ -317,6 +317,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( ../, + ../.., ../../lib/, ../../lib/include/, ../../lib/include/mat/, @@ -380,6 +381,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( ../, + ../.., ../../lib/, ../../lib/include/, ../../lib/include/mat/, From 9870c05269fca8a47dff4f24791bd1daa81aca5c Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 23:33:56 -0800 Subject: [PATCH 45/59] update iOS version --- .github/workflows/build-ios-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index dae79812d..dc517651e 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -25,7 +25,7 @@ jobs: matrix: os: [macos-13, macos-15] config: [release, debug] - simulator: ["'iPhone 16'", "'iPad Air 11-inch (M2)'"] + simulator: ["'iPhone 15'", "'iPad Air 11-inch (M2)'"] runs-on: ${{ matrix.os }} steps: - name: Grant write permissions to /usr/local From eee6b7eccc36a3af39166cac3df71700f2028b1b Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 7 Feb 2025 23:50:27 -0800 Subject: [PATCH 46/59] revert iOS version --- .github/workflows/build-ios-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index dc517651e..dae79812d 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -25,7 +25,7 @@ jobs: matrix: os: [macos-13, macos-15] config: [release, debug] - simulator: ["'iPhone 15'", "'iPad Air 11-inch (M2)'"] + simulator: ["'iPhone 16'", "'iPad Air 11-inch (M2)'"] runs-on: ${{ matrix.os }} steps: - name: Grant write permissions to /usr/local From ac2c6087adef6488c3f4c279c76475578c03b309 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 08:45:21 -0800 Subject: [PATCH 47/59] Set OS version for xcodebuild --- build-tests-ios.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tests-ios.sh b/build-tests-ios.sh index 69d81be97..44bfe6579 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -15,7 +15,7 @@ echo "End of build-ios.sh" # dyld_info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a cd tests/unittests -xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" -verbose +xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,OS=18.2,name=$SIMULATOR" -verbose cd ../functests -xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,name=$SIMULATOR" -verbose +xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,OS=18.2,name=$SIMULATOR" -verbose From 97efad0ed776a377967370330e295080e12e063a Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 08:49:04 -0800 Subject: [PATCH 48/59] Log destinations --- build-tests-ios.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-tests-ios.sh b/build-tests-ios.sh index 44bfe6579..b0914286d 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -15,6 +15,9 @@ echo "End of build-ios.sh" # dyld_info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a cd tests/unittests + +xcodebuild -showdestinations +echo 'End of xcodebuild -showdestinations' xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,OS=18.2,name=$SIMULATOR" -verbose cd ../functests From 6b65f60d04ac90cbd024e1d7c766349072ee53b3 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 09:11:16 -0800 Subject: [PATCH 49/59] Add scheme --- build-tests-ios.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tests-ios.sh b/build-tests-ios.sh index b0914286d..b5f1e624f 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -16,7 +16,7 @@ echo "End of build-ios.sh" cd tests/unittests -xcodebuild -showdestinations +xcodebuild -scheme iOSUnitTests -showdestinations echo 'End of xcodebuild -showdestinations' xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,OS=18.2,name=$SIMULATOR" -verbose From 98af7d26015ef0d6236f2ae1a8fd5f98586b891b Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 10:03:55 -0800 Subject: [PATCH 50/59] Log sdk version --- build-tests-ios.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-tests-ios.sh b/build-tests-ios.sh index b5f1e624f..115fcda95 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -18,6 +18,8 @@ cd tests/unittests xcodebuild -scheme iOSUnitTests -showdestinations echo 'End of xcodebuild -showdestinations' +xcodebuild -showsdks -json +echo 'End of xcodebuild -showsdks -json' xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,OS=18.2,name=$SIMULATOR" -verbose cd ../functests From e738e189b114fc74b8359755c088c4b6b8308d66 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 10:08:49 -0800 Subject: [PATCH 51/59] More logs --- build-tests-ios.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-tests-ios.sh b/build-tests-ios.sh index 115fcda95..9e642787d 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -20,6 +20,8 @@ xcodebuild -scheme iOSUnitTests -showdestinations echo 'End of xcodebuild -showdestinations' xcodebuild -showsdks -json echo 'End of xcodebuild -showsdks -json' +xcrun simctl list devices available +echo 'End of xcrun simctl list devices available' xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,OS=18.2,name=$SIMULATOR" -verbose cd ../functests From a79200bfc813b48982f852a703fbf8e7174be5cb Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 10:36:43 -0800 Subject: [PATCH 52/59] Update iOS versio in CI matrics --- .github/workflows/build-ios-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index dae79812d..75258b37d 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -25,7 +25,7 @@ jobs: matrix: os: [macos-13, macos-15] config: [release, debug] - simulator: ["'iPhone 16'", "'iPad Air 11-inch (M2)'"] + simulator: ["'iPhone 15'", "'iPad Pro (11-inch) (4th generation)'"] runs-on: ${{ matrix.os }} steps: - name: Grant write permissions to /usr/local From 202439865838c1653b13e7f4d9c4b03fd2c2a56a Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 10:37:26 -0800 Subject: [PATCH 53/59] Remove OS version --- build-tests-ios.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tests-ios.sh b/build-tests-ios.sh index 9e642787d..e30778cea 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -22,7 +22,7 @@ xcodebuild -showsdks -json echo 'End of xcodebuild -showsdks -json' xcrun simctl list devices available echo 'End of xcrun simctl list devices available' -xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,OS=18.2,name=$SIMULATOR" -verbose +xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" -verbose cd ../functests -xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,OS=18.2,name=$SIMULATOR" -verbose +xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,name=$SIMULATOR" -verbose From ba3649592daeb0532346bf278ba6db16a6e4ac92 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 10:48:02 -0800 Subject: [PATCH 54/59] Remvoe macos-13 --- .github/workflows/build-ios-mac.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index 75258b37d..9b151048c 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -23,9 +23,9 @@ jobs: build: strategy: matrix: - os: [macos-13, macos-15] + os: [macos-15] config: [release, debug] - simulator: ["'iPhone 15'", "'iPad Pro (11-inch) (4th generation)'"] + simulator: ["'iPhone 16'", "'iPad Air 11-inch (M2)'"] runs-on: ${{ matrix.os }} steps: - name: Grant write permissions to /usr/local From 69fcf702ebfd07716a3a966f51e5c9d2e3f40f3d Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 19:22:05 -0800 Subject: [PATCH 55/59] Delete old workflow --- .github/workflows/build-ios-mac11.yml | 36 --------------------------- 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/build-ios-mac11.yml diff --git a/.github/workflows/build-ios-mac11.yml b/.github/workflows/build-ios-mac11.yml deleted file mode 100644 index 2bcb16875..000000000 --- a/.github/workflows/build-ios-mac11.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: C/C++ CI for iOS - -on: - push: - branches: - - master - - main - - dev - - dev/* - - release/* - - buildme/* - - pull_request: - branches: - - master - - main - - dev - - schedule: - - cron: 0 2 * * 1-5 - -jobs: - build: - runs-on: macOS-11 - strategy: - matrix: - config: [release, debug] - simulator: ["'iPhone 8'", "'iPad Air (3rd generation)'"] - steps: - - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - continue-on-error: true - - name: build - run: export IOS_DEPLOYMENT_TARGET=11.0 && ./build-tests-ios.sh ${{ matrix.config }} ${{ matrix.simulator }} From 86e1d65ba049e84c69e9bcc45c58f3536ca6a902 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 19:26:13 -0800 Subject: [PATCH 56/59] Cleanup --- build-gtest.sh | 5 +---- build-ios.sh | 1 - build-tests-ios.sh | 11 +++-------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/build-gtest.sh b/build-gtest.sh index b91a8b84f..4c73f3382 100755 --- a/build-gtest.sh +++ b/build-gtest.sh @@ -15,8 +15,6 @@ else fi cd `dirname $0` -pwd -ls third_party/googletest GTEST_PATH=third_party/googletest if [ ! "$(ls -A $GTEST_PATH/CMakeLists.txt)" ]; then echo Clone googletest from google/googletest:master ... @@ -74,9 +72,8 @@ cmake -Dgtest_build_samples=OFF \ -DBUILD_IOS=$IOS_BUILD \ -DARCH=$ARCH \ .. -make VERBOSE=1 +make -# dyld-info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/third_party/googletest/build/lib/libgtest.a popd # CTEST_OUTPUT_ON_FAILURE=1 make test # make install diff --git a/build-ios.sh b/build-ios.sh index d213e3958..1fc411a7c 100755 --- a/build-ios.sh +++ b/build-ios.sh @@ -25,7 +25,6 @@ elif [ "$1" == "debug" ]; then fi # Set Architecture: arm64, arm64e or x86_64 -/usr/bin/uname -a IOS_ARCH=$(/usr/bin/uname -m) if [ "$1" == "arm64" ]; then IOS_ARCH="arm64" diff --git a/build-tests-ios.sh b/build-tests-ios.sh index e30778cea..de02886f4 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -8,21 +8,16 @@ SIMULATOR=${2:-iPhone 8} set -e -echo "Building build-ios.sh" ./build-ios.sh ${SKU} -echo "End of build-ios.sh" # dyld_info /Users/runner/work/cpp_client_telemetry/cpp_client_telemetry/out/lib/libmat.a cd tests/unittests -xcodebuild -scheme iOSUnitTests -showdestinations -echo 'End of xcodebuild -showdestinations' -xcodebuild -showsdks -json -echo 'End of xcodebuild -showsdks -json' xcrun simctl list devices available echo 'End of xcrun simctl list devices available' -xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" -verbose + +xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR" cd ../functests -xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,name=$SIMULATOR" -verbose +xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,name=$SIMULATOR" From bb61474ffdfa73d949460990f154ea3d6ab80a0f Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 19:41:46 -0800 Subject: [PATCH 57/59] Add macos-13 to CI workflow --- .github/workflows/build-ios-mac.yml | 9 +++++++-- build-tests-ios.sh | 3 --- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index 9b151048c..c9b00df69 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -23,9 +23,14 @@ jobs: build: strategy: matrix: - os: [macos-15] + os: [macos-13, macos-15] config: [release, debug] - simulator: ["'iPhone 16'", "'iPad Air 11-inch (M2)'"] + simulator: ["'iPhone 15'", "'iPad Pro (11-inch) (4th generation)'", "'iPhone 16'", "'iPad Air 11-inch (M2)'"] + exclude: + - os: macos-13 + simulator: ["'iPhone 16'", "'iPad Air 11-inch (M2)'"] + - os: macos-15 + simulator: ["'iPhone 15'", "'iPad Pro (11-inch) (4th generation)'"] runs-on: ${{ matrix.os }} steps: - name: Grant write permissions to /usr/local diff --git a/build-tests-ios.sh b/build-tests-ios.sh index de02886f4..bf29a50b3 100755 --- a/build-tests-ios.sh +++ b/build-tests-ios.sh @@ -1,7 +1,4 @@ #!/bin/sh -// Add current user -current_user=`id` -echo "CURRENT USER:" $current_user cd ${0%/*} SKU=${1:-release} SIMULATOR=${2:-iPhone 8} From c86addd46dbf60855dd513f0d9ab879de9dd833a Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 19:45:40 -0800 Subject: [PATCH 58/59] Remove unnecessary include --- tests/functests/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/functests/CMakeLists.txt b/tests/functests/CMakeLists.txt index ccc080d01..2551230c1 100644 --- a/tests/functests/CMakeLists.txt +++ b/tests/functests/CMakeLists.txt @@ -49,10 +49,6 @@ endif() source_group(" " REGULAR_EXPRESSION "") source_group("common" REGULAR_EXPRESSION "/tests/common/") -message("-- functests: CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}") - -include_directories( ${CMAKE_SOURCE_DIR} ) - if(BUILD_IOS) add_library(FuncTests ${SRCS} ${TESTS_COMMON_SRCS}) else() @@ -67,7 +63,7 @@ if(PAL_IMPLEMENTATION STREQUAL "WIN32") message("--- WIN32: ... ${CMAKE_BINARY_DIR}/zlib") message("--- WIN32: ... ${CMAKE_BINARY_DIR}/sqlite") # link_directories(${CMAKE_BINARY_DIR}/gtest/ ${CMAKE_BINARY_DIR}/gmock/ ${CMAKE_BINARY_DIR}/zlib/ ${CMAKE_BINARY_DIR}/sqlite/) - include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../zlib) + include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../zlib ) target_link_libraries(FuncTests mat wininet.lib From ee32e40099b42ba4152282828e267919e4dcda3f Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Sat, 8 Feb 2025 20:09:29 -0800 Subject: [PATCH 59/59] Exclude unnecessary matrix --- .github/workflows/build-ios-mac.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ios-mac.yml b/.github/workflows/build-ios-mac.yml index c9b00df69..114696247 100644 --- a/.github/workflows/build-ios-mac.yml +++ b/.github/workflows/build-ios-mac.yml @@ -28,9 +28,13 @@ jobs: simulator: ["'iPhone 15'", "'iPad Pro (11-inch) (4th generation)'", "'iPhone 16'", "'iPad Air 11-inch (M2)'"] exclude: - os: macos-13 - simulator: ["'iPhone 16'", "'iPad Air 11-inch (M2)'"] + simulator: "'iPhone 16'" + - os: macos-13 + simulator: "'iPad Air 11-inch (M2)'" + - os: macos-15 + simulator: "'iPhone 15'" - os: macos-15 - simulator: ["'iPhone 15'", "'iPad Pro (11-inch) (4th generation)'"] + simulator: "'iPad Pro (11-inch) (4th generation)'" runs-on: ${{ matrix.os }} steps: - name: Grant write permissions to /usr/local