diff options
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/00-Common.cmake | 9 | ||||
-rw-r--r-- | indra/cmake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/cmake/Copy3rdPartyLibs.cmake | 4 | ||||
-rw-r--r-- | indra/cmake/LLKDU.cmake | 1 | ||||
-rw-r--r-- | indra/cmake/LLWindow.cmake | 2 | ||||
-rw-r--r-- | indra/cmake/NFDE.cmake | 42 | ||||
-rw-r--r-- | indra/cmake/SDL2.cmake | 7 | ||||
-rw-r--r-- | indra/cmake/Tracy.cmake | 6 | ||||
-rw-r--r-- | indra/cmake/bugsplat.cmake | 10 |
9 files changed, 66 insertions, 17 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index fc18ffebb5..1b138eaeaa 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -35,7 +35,7 @@ add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS) # Force enable SSE2 instructions in GLM per the manual # https://github.com/g-truc/glm/blob/master/manual.md#section2_10 -add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1) +add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1 GLM_ENABLE_EXPERIMENTAL=1) # Configure crash reporting set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds") @@ -49,6 +49,11 @@ if(NON_RELEASE_CRASH_REPORTING) add_compile_definitions( LL_SEND_CRASH_REPORTS=1) endif() +set(USE_LTO OFF CACHE BOOL "Enable Link Time Optimization") +if(USE_LTO) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) +endif() + # Don't bother with a MinSizeRel or Debug builds. set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release" CACHE STRING "Supported build types." FORCE) @@ -102,7 +107,7 @@ if (WINDOWS) #ND: When using something like buildcache (https://github.com/mbitsnbites/buildcache) # to make those wrappers work /Zi must be changed to /Z7, as /Zi due to it's nature is not compatible with caching - if( ${CMAKE_CXX_COMPILER_LAUNCHER} MATCHES ".*cache.*") + if(${CMAKE_CXX_COMPILER_LAUNCHER} MATCHES ".*cache.*") add_compile_options( /Z7 ) string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 9017fc2fb4..1083d7f2c4 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -43,6 +43,7 @@ set(cmake_SOURCE_FILES Lualibs.cmake Meshoptimizer.cmake NDOF.cmake + NFDE.cmake OPENAL.cmake OpenGL.cmake OpenJPEG.cmake @@ -56,6 +57,7 @@ set(cmake_SOURCE_FILES TemplateCheck.cmake TinyEXR.cmake TinyGLTF.cmake + Tracy.cmake Tut.cmake UI.cmake UnixInstall.cmake diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index e98c77497b..bae3dc5d94 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -200,7 +200,6 @@ elseif(LINUX) libortp.so libvivoxoal.so.1 libvivoxsdk.so - libSDL2.so ) set(slvoice_files SLVoice) @@ -214,7 +213,8 @@ elseif(LINUX) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") # *FIX - figure out what to do with duplicate libalut.so here -brad set(release_files - ) + libSDL2-2.0.so.0 + ) if( USE_AUTOBUILD_3P ) list( APPEND release_files diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 668b07ffab..6d27dcc286 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -23,4 +23,5 @@ if (USE_KDU) ${AUTOBUILD_INSTALL_DIR}/include/kdu ${LIBS_OPEN_DIR}/llkdu ) + target_compile_definitions(ll::kdu INTERFACE KDU_X86_INTRINSICS=1 KDU_NO_THREADS=1) endif (USE_KDU) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index a5791f1bef..3bdca544ac 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -9,5 +9,5 @@ include_guard() if (LINUX) # linux uses SDL2 for window and keyboard - target_compile_definitions( ll::SDL2 INTERFACE LL_USE_SDL_KEYBOARD=1 ) + target_compile_definitions( ll::SDL2 INTERFACE LL_USE_SDL_WINDOW=1 LL_USE_SDL_KEYBOARD=1 ) endif (LINUX) diff --git a/indra/cmake/NFDE.cmake b/indra/cmake/NFDE.cmake new file mode 100644 index 0000000000..196ba575b2 --- /dev/null +++ b/indra/cmake/NFDE.cmake @@ -0,0 +1,42 @@ +# -*- cmake -*- +if(LINUX) + set(USE_NFDE ON CACHE BOOL "Use Native File Dialog wrapper library") + set(USE_NFDE_PORTAL ON CACHE BOOL "Use NFDE XDG Portals") +endif() + +include_guard() + +add_library(ll::nfde INTERFACE IMPORTED) +if(USE_NFDE) + include(Prebuilt) + use_prebuilt_binary(nfde) + + target_compile_definitions( ll::nfde INTERFACE LL_NFD=1) + + if (WINDOWS) + target_link_libraries( ll::nfde INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nfd.lib) + elseif (DARWIN) + target_link_libraries( ll::nfde INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libnfd.a) + elseif (LINUX) + if(USE_NFDE_PORTAL) + target_link_libraries( ll::nfde INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libnfd_portal.a) + else() + target_link_libraries( ll::nfde INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libnfd_gtk.a) + endif() + endif () + + if (LINUX) + find_package(PkgConfig REQUIRED) + if(NOT USE_NFDE_PORTAL) + pkg_check_modules(GTK3 REQUIRED gtk+-3.0) + target_link_libraries(ll::nfde INTERFACE ${GTK3_LINK_LIBRARIES}) + else() + pkg_check_modules(DBUS REQUIRED dbus-1) + target_link_libraries(ll::nfde INTERFACE ${DBUS_LINK_LIBRARIES}) + endif() + endif() + + target_include_directories( ll::nfde SYSTEM INTERFACE + ${LIBS_PREBUILT_DIR}/include/nfde + ) +endif() diff --git a/indra/cmake/SDL2.cmake b/indra/cmake/SDL2.cmake index 87195ed108..a464133f3f 100644 --- a/indra/cmake/SDL2.cmake +++ b/indra/cmake/SDL2.cmake @@ -12,11 +12,8 @@ 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() + PATHS "${LIBS_PREBUILT_DIR}/lib/release" REQUIRED) target_link_libraries( ll::SDL2 INTERFACE "${SDL2_LIBRARY}" ) -target_include_directories( ll::SDL2 SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include" ) +target_include_directories( ll::SDL2 SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/SDL2" ) diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake index 9eee9eb57f..e3f46cca9b 100644 --- a/indra/cmake/Tracy.cmake +++ b/indra/cmake/Tracy.cmake @@ -20,6 +20,7 @@ endif(LINUX) if (USE_TRACY) option(USE_TRACY_ON_DEMAND "Use on-demand Tracy profiling." ON) option(USE_TRACY_LOCAL_ONLY "Disallow remote Tracy profiling." OFF) + option(USE_TRACY_GPU "Use Tracy GPU profiling" OFF) use_system_binary(tracy) use_prebuilt_binary(tracy) @@ -36,9 +37,8 @@ if (USE_TRACY) target_compile_definitions(ll::tracy INTERFACE -DTRACY_NO_BROADCAST=1 -DTRACY_ONLY_LOCALHOST=1) endif () - # GHA runners don't always provide invariant TSC support, but always build with LL_TESTS enabled - if (DARWIN AND LL_TESTS) - target_compile_definitions(ll::tracy INTERFACE -DTRACY_TIMER_FALLBACK=1) + if (USE_TRACY_GPU AND NOT DARWIN) # Tracy OpenGL mode is incompatible with macOS/iOS + target_compile_definitions(ll::tracy INTERFACE -DLL_PROFILER_ENABLE_TRACY_OPENGL=1) endif () # See: indra/llcommon/llprofiler.h diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index 0798d4f51f..8916cb282c 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -5,14 +5,15 @@ if (INSTALL_PROPRIETARY AND NOT LINUX) else (BUGSPLAT_DB) set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system") endif (BUGSPLAT_DB) -else (INSTALL_PROPRIETARY AND NOT LINUX) +else () set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system") -endif (INSTALL_PROPRIETARY AND NOT LINUX) + set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") +endif () include_guard() add_library( ll::bugsplat INTERFACE IMPORTED ) -if (USE_BUGSPLAT) +if (USE_BUGSPLAT AND NOT LINUX) include(Prebuilt) use_prebuilt_binary(bugsplat) if (WINDOWS) @@ -36,6 +37,7 @@ if (USE_BUGSPLAT) set_property( TARGET ll::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT) else() + set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system" FORCE) set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name" FORCE) -endif (USE_BUGSPLAT) +endif () |