From d3521b4462195cfe882b2cc8eb4e7c5e948c0fb6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 10:28:46 +0200 Subject: Remove obsolete and unmaintained USE_SYSTEMLIBS --- indra/cmake/Variables.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/cmake/Variables.cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index e72475cbc4..56916504b5 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -214,7 +214,6 @@ set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer") set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.") set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside") -set(USESYSTEMLIBS OFF CACHE BOOL "Use libraries from your system rather than Linden-supplied prebuilt libraries.") set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.") -- cgit v1.2.3 From 241919e7f7986c11586a49bff53cf19c2c0e0ea6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 19:21:55 +0200 Subject: Rework cmake, the original plan was to maybe be able to use conan targets with the same name (that's why 3ps had names like apr::apr), but it's safer and saner to put the LL 3ps under the ll:: prefix. This also allows means it is possible to get rid of that bad "if( TRAGET ...) return() endif()" pattern and rather use include_guard(). --- indra/cmake/Variables.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/cmake/Variables.cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 56916504b5..0cc4b85583 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -15,12 +15,10 @@ if ("$ENV{LL_BUILD}" STREQUAL "") message(FATAL_ERROR "Environment variable LL_BUILD must be set") endif () +include_guard() # Relative and absolute paths to subtrees. -if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) -set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") - if(NOT DEFINED COMMON_CMAKE_DIR) set(COMMON_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake") endif(NOT DEFINED COMMON_CMAKE_DIR) @@ -219,4 +217,3 @@ set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header dire source_group("CMake Rules" FILES CMakeLists.txt) -endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) -- cgit v1.2.3 From 756a10eeace5891c17c6894b0df44f2b9b3ea078 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 1 May 2022 13:37:44 +0200 Subject: Simplify cmake files by uaing generator expressions and be more configuration specific, rather than staging files to Release and RelWithdebInfo all the time --- indra/cmake/Variables.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/cmake/Variables.cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 0cc4b85583..e0e1161606 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -217,3 +217,5 @@ set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header dire source_group("CMake Rules" FILES CMakeLists.txt) +get_property(LL_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +MESSAGE( "Multi config generator: ${LL_GENERATOR_IS_MULTI_CONFIG}" ) -- cgit v1.2.3 From 09e38c5caac6c8467edbbb8527e04503f1afe5f3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 17:00:01 +0200 Subject: Remove logging. --- indra/cmake/Variables.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/Variables.cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index e0e1161606..cb9d22abd2 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -218,4 +218,4 @@ set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header dire source_group("CMake Rules" FILES CMakeLists.txt) get_property(LL_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -MESSAGE( "Multi config generator: ${LL_GENERATOR_IS_MULTI_CONFIG}" ) + -- cgit v1.2.3 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/cmake/Variables.cmake') 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 From 07a7c4e1909749ca2f50d155c0de3fdfdbb34952 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 17:23:20 +0200 Subject: ADDRESS_SIZE auto detection was broken with python3, fix this. - Simplify detection by using regex - OSX is always 64 bit --- indra/cmake/Variables.cmake | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'indra/cmake/Variables.cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 3098b9aa59..4f40516917 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -79,27 +79,28 @@ elseif (ADDRESS_SIZE EQUAL 64) #message(STATUS "ADDRESS_SIZE is 64") set(ARCH x86_64) else (ADDRESS_SIZE EQUAL 32) - #message(STATUS "ADDRESS_SIZE is UNRECOGNIZED: '${ADDRESS_SIZE}'") - # Use Python's platform.machine() since uname -m isn't available everywhere. - # Even if you can assume cygwin uname -m, the answer depends on whether - # you're running 32-bit cygwin or 64-bit cygwin! But even 32-bit Python will - # report a 64-bit processor. - execute_process(COMMAND - "${PYTHON_EXECUTABLE}" "-c" - "import platform; print platform.machine()" - OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) - # We expect values of the form i386, i686, x86_64, AMD64. - # In CMake, expressing ARCH.endswith('64') is awkward: - string(LENGTH "${ARCH}" ARCH_LENGTH) - math(EXPR ARCH_LEN_2 "${ARCH_LENGTH} - 2") - string(SUBSTRING "${ARCH}" ${ARCH_LEN_2} 2 ARCH_LAST_2) - if (ARCH_LAST_2 STREQUAL 64) - #message(STATUS "ARCH is detected as 64; ARCH is ${ARCH}") + # Note we cannnot use if(DARWIN) here, this variable is set way lower + if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" ) set(ADDRESS_SIZE 64) - else () - #message(STATUS "ARCH is detected as 32; ARCH is ${ARCH}") - set(ADDRESS_SIZE 32) - endif () + set(ARCH x86_64) + else() + # Use Python's platform.machine() since uname -m isn't available everywhere. + # Even if you can assume cygwin uname -m, the answer depends on whether + # you're running 32-bit cygwin or 64-bit cygwin! But even 32-bit Python will + # report a 64-bit processor. + execute_process(COMMAND + "${PYTHON_EXECUTABLE}" "-c" + "import platform; print( platform.machine() )" + OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) + string( REGEX MATCH ".*(64)$" RE_MATCH "${ARCH}" ) + if( RE_MATCH AND ${CMAKE_MATCH_1} STREQUAL "64" ) + set(ADDRESS_SIZE 64) + set(ARCH x86_64) + else() + set(ADDRESS_SIZE 32) + set(ARCH i686) + endif() + endif() endif (ADDRESS_SIZE EQUAL 32) if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") -- cgit v1.2.3 From 42820f834fcd68c40dc71f1be2a2b7d50096f148 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 17:29:16 +0200 Subject: Remove unused LL_ARCH/LL_ARCH_DIR --- indra/cmake/Variables.cmake | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'indra/cmake/Variables.cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 4f40516917..653db2069a 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -73,13 +73,11 @@ endif (NOT CMAKE_BUILD_TYPE) # If someone has specified an address size, use that to determine the # architecture. Otherwise, let the architecture specify the address size. if (ADDRESS_SIZE EQUAL 32) - #message(STATUS "ADDRESS_SIZE is 32") set(ARCH i686) elseif (ADDRESS_SIZE EQUAL 64) - #message(STATUS "ADDRESS_SIZE is 64") set(ARCH x86_64) else (ADDRESS_SIZE EQUAL 32) - # Note we cannnot use if(DARWIN) here, this variable is set way lower + # Note we cannot use if(DARWIN) here, this variable is set way lower if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" ) set(ADDRESS_SIZE 64) set(ARCH x86_64) @@ -105,8 +103,6 @@ endif (ADDRESS_SIZE EQUAL 32) if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(WINDOWS ON BOOL FORCE) - set(LL_ARCH ${ARCH}_win32) - set(LL_ARCH_DIR ${ARCH}-win32) endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") @@ -133,9 +129,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") include(ConfigurePkgConfig) - set(LL_ARCH ${ARCH}_linux) - set(LL_ARCH_DIR ${ARCH}-linux) - if (INSTALL_PROPRIETARY) # Only turn on headless if we can find osmesa libraries. include(FindPkgConfig) @@ -204,9 +197,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_OSX_ARCHITECTURES "${ARCH}") string(REPLACE "i686" "i386" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") string(REPLACE "AMD64" "x86_64" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") - - set(LL_ARCH ${ARCH}_darwin) - set(LL_ARCH_DIR universal-darwin) endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Default deploy grid -- cgit v1.2.3