From d6c170a66de1fe6cf6287ca970b79d0ae6e98149 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 17:00:27 +0200 Subject: 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. --- indra/cmake/Variables.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra') 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() -- cgit v1.2.3