diff options
author | Nicky <nicky.dasmijn@gmail.com> | 2022-05-07 17:00:27 +0200 |
---|---|---|
committer | Nicky <nicky.dasmijn@gmail.com> | 2022-05-07 17:00:27 +0200 |
commit | d6c170a66de1fe6cf6287ca970b79d0ae6e98149 (patch) | |
tree | 1438ec9890d87f9c240d23b15de9110395004e1c /indra | |
parent | 09e38c5caac6c8467edbbb8527e04503f1afe5f3 (diff) |
Cache ENV{LL_BUILD} to LL_BUILD_ENV:
- ENV{LL_BUILD} takes precedence
- if ENV{LL_BUILD} is not set but LL_BUILD-ENV is, set ENV{LL_BUILD} to
the cached version
- error if none of the two is set
Caching the variable and reusing it lets cmake run when not called by
autobuild itself. This happens when xcode or visual studio detect it
needs to be re rerun and call it for the "cmake" target. Not having
LL_BUILD then makes those targets fail.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/cmake/Variables.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index cb9d22abd2..3098b9aa59 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -12,8 +12,13 @@ # Switches set here and in 00-Common.cmake must agree with # https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables # Reading $LL_BUILD is an attempt to directly use those switches. -if ("$ENV{LL_BUILD}" STREQUAL "") +if ("$ENV{LL_BUILD}" STREQUAL "" AND "${LL_BUILD_ENV}" STREQUAL "" ) message(FATAL_ERROR "Environment variable LL_BUILD must be set") +elseif("$ENV{LL_BUILD}" STREQUAL "") + set( ENV{LL_BUILD} "${LL_BUILD_ENV}" ) + message( "Setting ENV{LL_BUILD} to cached variable ${LL_BUILD_ENV}" ) +else() + set( LL_BUILD_ENV "$ENV{LL_BUILD}" CACHE STRING "Save environment" FORCE ) endif () include_guard() |