summaryrefslogtreecommitdiff
path: root/indra/CMakeLists.txt
diff options
context:
space:
mode:
authorNicky Dasmijn <nicky.dasmijn@posteo.nl>2022-09-16 23:15:49 +0200
committerNicky Dasmijn <nicky.dasmijn@posteo.nl>2022-09-16 23:15:49 +0200
commit0710d95f4b6b1a1c9ce242e7ce0aa7e828e6fdc1 (patch)
tree14f280cb1d3a8d1c2b6404642f4c0fd3185466dd /indra/CMakeLists.txt
parentf08f20db5f9936956c2210b73011f7e2ff45af03 (diff)
parent6fdd35d500113b6a9d3f4b15342a1baf1e15fa7c (diff)
Merge remote-tracking branch 'origin/DRTVWR-543-maint_cmake' into DRTVWR-568_cmake
Diffstat (limited to 'indra/CMakeLists.txt')
-rw-r--r--indra/CMakeLists.txt34
1 files changed, 26 insertions, 8 deletions
diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt
index 0e7f52d189..7e70a44cf2 100644
--- a/indra/CMakeLists.txt
+++ b/indra/CMakeLists.txt
@@ -4,23 +4,40 @@
# other commands to guarantee full compatibility
# with the version specified
## 3.8 added VS_DEBUGGER_WORKING_DIRECTORY support
+## 3.13/12 is needed for add_link_options/add_compile_definitions
## 3.14 added FILE CREATE_LINK
-cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR)
+## 3.16 is needed for target_precompile_headers
+cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING
"The root project/makefile/solution name. Defaults to SecondLife.")
project(${ROOT_PROJECT_NAME})
-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_BINARY_DIR}")
+
+include(conanbuildinfo OPTIONAL RESULT_VARIABLE USE_CONAN )
+if( USE_CONAN )
+ set( USE_CONAN ON )
+ set( USE_AUTOBUILD_3P OFF )
+ conan_basic_setup(TARGETS NO_OUTPUT_DIRS)
+ add_compile_definitions(LL_USESYSTEMLIBS USE_CONAN NO_AUTOBUILD_3P)
+else()
+ set( USE_CONAN OFF )
+ set( USE_AUTOBUILD_3P ON )
+endif()
+
+# The viewer code base can now be successfully compiled with -std=c++14. But
+# turning that on in the generic viewer-build-variables/variables file would
+# potentially require tweaking each of our ~50 third-party library builds.
+# Until we decide to set -std=c++14 in viewer-build-variables/variables, set
+# it locally here: we want to at least prevent inadvertently reintroducing
+# viewer code that would fail with C++14.
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(Variables)
include(BuildVersion)
-set(LEGACY_STDIO_LIBS)
-if (WINDOWS)
- set(LEGACY_STDIO_LIBS legacy_stdio_definitions)
-endif (WINDOWS)
-
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
@@ -60,8 +77,10 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
+if( LL_TESTS )
# Legacy C++ tests. Build always, run if LL_TESTS is true.
add_subdirectory(${VIEWER_PREFIX}test)
+endif()
if (ENABLE_MEDIA_PLUGINS)
# viewer media plugins
@@ -73,7 +92,6 @@ if (LINUX)
include(LLAppearanceUtility)
add_subdirectory(${LLAPPEARANCEUTILITY_SRC_DIR} ${LLAPPEARANCEUTILITY_BIN_DIR})
endif (INSTALL_PROPRIETARY)
- add_dependencies(viewer linux-crash-logger-strip-target)
elseif (WINDOWS)
# cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake
if (EXISTS ${VIEWER_DIR}win_setup)