From 10484181dc150a6c3a1f8cb05386d9691f9b431b Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 5 Sep 2024 07:16:57 -0700 Subject: [PATCH 1/3] 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 2/3] 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 3/3] 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")