diff options
author | Brad Linden <brad@lindenlab.com> | 2023-05-03 15:47:19 -0700 |
---|---|---|
committer | Brad Linden <brad@lindenlab.com> | 2023-05-03 15:47:19 -0700 |
commit | 7d23f91b1681a99d7fd22183bb11c486d9d7d27f (patch) | |
tree | 0edd3a2d36225b61ca3f468f1dc90e7a2279dbfa | |
parent | e41cb7b5db144b13b4e77390915d928c477eb690 (diff) |
Added ability to disable required OSX_SYSROOT cmake checks
-rw-r--r-- | .github/workflows/build.yaml | 1 | ||||
-rw-r--r-- | indra/cmake/Variables.cmake | 18 |
2 files changed, 12 insertions, 7 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1a2731209a..60a1406f20 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,6 +30,7 @@ jobs: DEVELOPER_DIR: ${{ matrix.developer_dir }} LOGFAIL: debug # Show details when tests fail GIT_REF: ${{ github.head_ref || github.ref }} + LL_SKIP_REQUIRE_SYSROOT: 1 steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 79de3a9055..ade0653cf7 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -173,13 +173,17 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}") message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'") - string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}") - list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx) - if ("${sysroot_idx}" LESS 0) - message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'") - endif () - math(EXPR sysroot_idx "${sysroot_idx} + 1") - list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT) + # allow disabling this check by setting LL_SKIP_REQUIRE_SYSROOT either ON as cmake cache var or non-empty as environment var + set(LL_SKIP_REQUIRE_SYSROOT OFF CACHE BOOL "Skip requirent to set toolchain sysroot ahead of time. Not skipped by default for consistency, but skipping can be useful for selecting alternative xcode versions side by side") + if("$ENV{LL_SKIP_REQUIRE_SYSROOT}" STREQUAL "" AND NOT ${LL_SKIP_REQUIRE_SYSROOT}) + string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}") + list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx) + if ("${sysroot_idx}" LESS 0) + message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'") + endif () + math(EXPR sysroot_idx "${sysroot_idx} + 1") + list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT) + endif() message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'") set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0") |