summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/00-COMPILE-LINK-RUN.txt2
-rw-r--r--indra/cmake/00-Common.cmake46
-rw-r--r--indra/cmake/CMakeLists.txt1
-rw-r--r--indra/cmake/Copy3rdPartyLibs.cmake10
-rw-r--r--indra/cmake/Havok.cmake37
-rw-r--r--indra/cmake/LLWindow.cmake13
-rw-r--r--indra/cmake/OPENAL.cmake6
-rw-r--r--indra/cmake/Prebuilt.cmake2
-rw-r--r--indra/cmake/SDL2.cmake22
-rw-r--r--indra/cmake/UI.cmake3
-rw-r--r--indra/cmake/bugsplat.cmake8
11 files changed, 75 insertions, 75 deletions
diff --git a/indra/cmake/00-COMPILE-LINK-RUN.txt b/indra/cmake/00-COMPILE-LINK-RUN.txt
index 1933072a6d..6cff0c0f28 100644
--- a/indra/cmake/00-COMPILE-LINK-RUN.txt
+++ b/indra/cmake/00-COMPILE-LINK-RUN.txt
@@ -162,7 +162,7 @@ Linking
* Update the autobuild.xml of ALL consumers of the library. In
the case of zlib, that meant updating freetype, libpng, openssl,
- libxml2, fontconfig, curl, Boost, SDL, llqtwebkit, google-mock and
+ libxml2, fontconfig, curl, Boost, SDL2, llqtwebkit, google-mock and
colladadom.
* Confirm by test and observation that the consumers actually use
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 5cb25368d2..fc18ffebb5 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -155,30 +155,11 @@ if (LINUX)
-fvisibility=hidden
)
- set(GCC_CLANG_COMPATIBLE_WARNINGS
- -Wno-parentheses
- -Wno-deprecated
- -Wno-c++20-compat
- -Wno-pessimizing-move
- )
-
- set(CLANG_WARNINGS
- ${GCC_CLANG_COMPATIBLE_WARNINGS}
- # Put clang specific warning configuration here
- )
-
- set(GCC_WARNINGS
- ${GCC_CLANG_COMPATIBLE_WARNINGS}
- )
-
add_link_options(
-Wl,--no-keep-memory
-Wl,--build-id
-Wl,--no-undefined
)
- if (NOT GCC_DISABLE_FATAL_WARNINGS)
- add_compile_options( -Werror )
- endif (NOT GCC_DISABLE_FATAL_WARNINGS)
# this stops us requiring a really recent glibc at runtime
add_compile_options(-fno-stack-protector)
@@ -189,9 +170,6 @@ if (LINUX)
-lstdc++
-lm
)
- add_compile_options(${CLANG_WARNINGS})
- else()
- add_compile_options(${GCC_WARNINGS})
endif()
endif (LINUX)
@@ -200,7 +178,7 @@ if (DARWIN)
set(CLANG_DISABLE_FATAL_WARNINGS OFF)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
- set(DARWIN_extra_cstar_flags "-Wno-unused-local-typedef -Wno-deprecated-declarations")
+ set(DARWIN_extra_cstar_flags "-Wno-deprecated-declarations")
# Ensure that CMAKE_CXX_FLAGS has the correct -g debug information format --
# see Variables.cmake.
string(REPLACE "-gdwarf-2" "-g${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}"
@@ -209,22 +187,26 @@ if (DARWIN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
-## Really?? On developer machines too?
-##set(ENABLE_SIGNING TRUE)
-##set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
+ ## Really?? On developer machines too?
+ ##set(ENABLE_SIGNING TRUE)
+ ##set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
# required for clang-15/xcode-15 since our boost package still uses deprecated std::unary_function/binary_function
# see https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#C++-Standard-Library
add_compile_definitions(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
+endif(DARWIN)
- set(GCC_WARNINGS -Wall -Wno-sign-compare -Wno-trigraphs)
-
- list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor )
+if(LINUX OR DARWIN)
+ add_compile_options(-Wall -Wno-sign-compare -Wno-trigraphs -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-local-typedef)
- if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13)
- list(APPEND GCC_WARNINGS -Wno-unused-but-set-variable -Wno-unused-variable )
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ add_compile_options(-Wno-stringop-truncation -Wno-parentheses -Wno-c++20-compat)
endif()
+ if (NOT GCC_DISABLE_FATAL_WARNINGS)
+ add_compile_options(-Werror)
+ endif ()
+
add_compile_options(${GCC_WARNINGS})
add_compile_options(-m${ADDRESS_SIZE})
-endif ()
+endif (LINUX OR DARWIN)
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index 16da388e61..9017fc2fb4 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -52,6 +52,7 @@ set(cmake_SOURCE_FILES
Prebuilt.cmake
PulseAudio.cmake
Python.cmake
+ SDL2.cmake
TemplateCheck.cmake
TinyEXR.cmake
TinyGLTF.cmake
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index ced012426f..e98c77497b 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -54,6 +54,7 @@ if(WINDOWS)
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(release_files
openjp2.dll
+ SDL2.dll
)
if(LLCOMMON_LINK_SHARED)
@@ -106,7 +107,8 @@ if(WINDOWS)
else(ADDRESS_SIZE EQUAL 32)
set(redist_find_path "$ENV{VCTOOLSREDISTDIR}x64\\Microsoft.VC${MSVC_TOOLSET_VER}.CRT")
endif(ADDRESS_SIZE EQUAL 32)
- get_filename_component(redist_path "${redist_find_path}" ABSOLUTE)
+ get_filename_component(redist_path_component "${redist_find_path}" ABSOLUTE)
+ set(redist_path ${redist_path_component} CACHE INTERNAL "MSVC Redist Path" FORCE)
MESSAGE(STATUS "VC Runtime redist path: ${redist_path}")
endif (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR})
@@ -132,12 +134,11 @@ if(WINDOWS)
msvcp${MSVC_VER}_2.dll
msvcp${MSVC_VER}_atomic_wait.dll
msvcp${MSVC_VER}_codecvt_ids.dll
- msvcr${MSVC_VER}.dll
vcruntime${MSVC_VER}.dll
vcruntime${MSVC_VER}_1.dll
vcruntime${MSVC_VER}_threads.dll
)
- if(redist_path AND EXISTS "${redist_path}/${release_msvc_file}")
+ if(DEFINED redist_path AND EXISTS "${redist_path}/${release_msvc_file}")
MESSAGE(STATUS "Copying redist file from ${redist_path}/${release_msvc_file}")
to_staging_dirs(
${redist_path}
@@ -169,6 +170,8 @@ elseif(DARWIN)
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(release_files
libndofdev.dylib
+ libSDL2.dylib
+ libSDL2-2.0.dylib
)
if(LLCOMMON_LINK_SHARED)
@@ -197,6 +200,7 @@ elseif(LINUX)
libortp.so
libvivoxoal.so.1
libvivoxsdk.so
+ libSDL2.so
)
set(slvoice_files SLVoice)
diff --git a/indra/cmake/Havok.cmake b/indra/cmake/Havok.cmake
index c544440adc..64e33f6c83 100644
--- a/indra/cmake/Havok.cmake
+++ b/indra/cmake/Havok.cmake
@@ -27,26 +27,26 @@ else (LL_DEBUG_HAVOK)
endif (LL_DEBUG_HAVOK)
set(HAVOK_LIBS
- hkBase
- hkCompat
+ hkgpConvexDecomposition
hkGeometryUtilities
- hkInternal
hkSerialize
hkSceneData
hkpCollide
hkpUtilities
hkpConstraintSolver
hkpDynamics
- hkpInternal
- hkaiInternal
hkaiPathfinding
hkaiAiPhysicsBridge
- hkcdInternal
hkcdCollide
hkpVehicle
hkVisualize
hkaiVisualize
- hkgpConvexDecomposition
+ hkaiInternal
+ hkcdInternal
+ hkpInternal
+ hkInternal
+ hkCompat
+ hkBase
)
unset(HK_DEBUG_LIBRARIES)
@@ -60,16 +60,22 @@ if (DEBUG_PREBUILT)
# but making it pretty is a lot more work
message(STATUS "${ARGN}")
endfunction(DEBUG_MESSAGE)
+ function(DEBUG_EXEC_FUNC)
+ execute_process(COMMAND ${ARGN})
+ endfunction(DEBUG_EXEC_FUNC)
else (DEBUG_PREBUILT)
# without DEBUG_PREBUILT, DEBUG_MESSAGE() is a no-op
function(DEBUG_MESSAGE)
endfunction(DEBUG_MESSAGE)
+ function(DEBUG_EXEC_FUNC)
+ execute_process(COMMAND ${ARGN} OUTPUT_QUIET)
+ endfunction(DEBUG_EXEC_FUNC)
endif (DEBUG_PREBUILT)
# DEBUG_EXEC() reports each execute_process() before invoking
function(DEBUG_EXEC)
DEBUG_MESSAGE(${ARGN})
- execute_process(COMMAND ${ARGN})
+ DEBUG_EXEC_FUNC(${ARGN})
endfunction(DEBUG_EXEC)
# *TODO: Figure out why we need to extract like this...
@@ -79,9 +85,7 @@ foreach(HAVOK_LIB ${HAVOK_LIBS})
find_library(HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH})
if(LINUX)
- set(debug_dir "${HAVOK_DEBUG_LIBRARY_PATH}/${HAVOK_LIB}")
set(release_dir "${HAVOK_RELEASE_LIBRARY_PATH}/${HAVOK_LIB}")
- set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}")
# Try to avoid extracting havok library each time we run cmake.
if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted")
@@ -92,8 +96,8 @@ foreach(HAVOK_LIB ${HAVOK_LIBS})
if(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
DEBUG_MESSAGE("Extracting ${HAVOK_LIB}...")
- foreach(lib ${debug_dir} ${release_dir} ${relwithdebinfo_dir})
- DEBUG_EXEC("mkdir" ${lib})
+ foreach(lib ${release_dir})
+ DEBUG_EXEC("mkdir" "-p" ${lib})
DEBUG_EXEC("ar" "-xv" "../lib${HAVOK_LIB}.a"
WORKING_DIRECTORY ${lib})
endforeach(lib)
@@ -104,17 +108,12 @@ foreach(HAVOK_LIB ${HAVOK_LIBS})
endif()
- file(GLOB extracted_debug "${debug_dir}/*.o")
file(GLOB extracted_release "${release_dir}/*.o")
- file(GLOB extracted_relwithdebinfo "${relwithdebinfo_dir}/*.o")
-
- DEBUG_MESSAGE("extracted_debug ${debug_dir}/*.o")
DEBUG_MESSAGE("extracted_release ${release_dir}/*.o")
- DEBUG_MESSAGE("extracted_relwithdebinfo ${relwithdebinfo_dir}/*.o")
- list(APPEND HK_DEBUG_LIBRARIES ${extracted_debug})
+ list(APPEND HK_DEBUG_LIBRARIES ${extracted_release})
list(APPEND HK_RELEASE_LIBRARIES ${extracted_release})
- list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_relwithdebinfo})
+ list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_release})
else(LINUX)
# Win32
list(APPEND HK_DEBUG_LIBRARIES ${HAVOK_DEBUG_LIB_${HAVOK_LIB}})
diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake
index 23f4115aeb..a5791f1bef 100644
--- a/indra/cmake/LLWindow.cmake
+++ b/indra/cmake/LLWindow.cmake
@@ -3,18 +3,11 @@
include(Variables)
include(GLEXT)
include(Prebuilt)
+include(SDL2)
include_guard()
-add_library( ll::SDL INTERFACE IMPORTED )
-
if (LINUX)
- #Must come first as use_system_binary can exit this file early
- target_compile_definitions( ll::SDL INTERFACE LL_SDL_VERSION=2 LL_SDL)
-
- #find_package(SDL2 REQUIRED)
- #target_link_libraries( ll::SDL INTERFACE SDL2::SDL2 SDL2::SDL2main X11)
-
- use_prebuilt_binary(SDL2)
- target_link_libraries( ll::SDL INTERFACE SDL2 X11)
+ # linux uses SDL2 for window and keyboard
+ target_compile_definitions( ll::SDL2 INTERFACE LL_USE_SDL_KEYBOARD=1 )
endif (LINUX)
diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake
index 347dd02cd7..355907bcf5 100644
--- a/indra/cmake/OPENAL.cmake
+++ b/indra/cmake/OPENAL.cmake
@@ -4,11 +4,7 @@ include(Prebuilt)
include_guard()
-# ND: Turn this off by default, the openal code in the viewer isn't very well maintained, seems
-# to have memory leaks, has no option to play music streams
-# It probably makes sense to to completely remove it
-
-set(USE_OPENAL OFF CACHE BOOL "Enable OpenAL")
+set(USE_OPENAL ON CACHE BOOL "Enable OpenAL")
# ND: To streamline arguments passed, switch from OPENAL to USE_OPENAL
# To not break all old build scripts convert old arguments but warn about it
if(OPENAL)
diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake
index a8c702bfef..c040090ea3 100644
--- a/indra/cmake/Prebuilt.cmake
+++ b/indra/cmake/Prebuilt.cmake
@@ -43,6 +43,8 @@ macro (use_prebuilt_binary _binary)
message(STATUS "Installing ${_binary}...")
execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}"
install
+ -A${ADDRESS_SIZE}
+ --skip-source-environment
--install-dir=${AUTOBUILD_INSTALL_DIR}
${_binary}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
diff --git a/indra/cmake/SDL2.cmake b/indra/cmake/SDL2.cmake
new file mode 100644
index 0000000000..87195ed108
--- /dev/null
+++ b/indra/cmake/SDL2.cmake
@@ -0,0 +1,22 @@
+# -*- cmake -*-
+cmake_minimum_required( VERSION 3.13 FATAL_ERROR )
+
+include(Linking)
+include( Prebuilt )
+include_guard()
+
+add_library( ll::SDL2 INTERFACE IMPORTED )
+
+use_system_binary( SDL2 )
+use_prebuilt_binary( SDL2 )
+
+find_library( SDL2_LIBRARY
+ NAMES SDL2
+ PATHS "${LIBS_PREBUILT_DIR}/lib/release")
+if ( "${SDL2_LIBRARY}" STREQUAL "SDL2_LIBRARY-NOTFOUND" )
+ message( FATAL_ERROR "unable to find SDL2_LIBRARY" )
+endif()
+
+target_link_libraries( ll::SDL2 INTERFACE "${SDL2_LIBRARY}" )
+target_include_directories( ll::SDL2 SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include" )
+
diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake
index 0df62808e7..ae039b4a47 100644
--- a/indra/cmake/UI.cmake
+++ b/indra/cmake/UI.cmake
@@ -21,9 +21,10 @@ if (LINUX)
Xext
Xft
Xinerama
+ X11
ll::fontconfig
ll::freetype
- ll::SDL
+ ll::SDL2
ll::glib
ll::gio
)
diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake
index 509981d72c..0798d4f51f 100644
--- a/indra/cmake/bugsplat.cmake
+++ b/indra/cmake/bugsplat.cmake
@@ -1,13 +1,13 @@
-if (INSTALL_PROPRIETARY)
+if (INSTALL_PROPRIETARY AND NOT LINUX)
# Note that viewer_manifest.py makes decision based on BUGSPLAT_DB and not USE_BUGSPLAT
if (BUGSPLAT_DB)
set(USE_BUGSPLAT ON CACHE BOOL "Use the BugSplat crash reporting system")
else (BUGSPLAT_DB)
set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system")
endif (BUGSPLAT_DB)
-else (INSTALL_PROPRIETARY)
+else (INSTALL_PROPRIETARY AND NOT LINUX)
set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system")
-endif (INSTALL_PROPRIETARY)
+endif (INSTALL_PROPRIETARY AND NOT LINUX)
include_guard()
add_library( ll::bugsplat INTERFACE IMPORTED )
@@ -36,6 +36,6 @@ if (USE_BUGSPLAT)
set_property( TARGET ll::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT)
else()
- set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name")
+ set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name" FORCE)
endif (USE_BUGSPLAT)