From 0500c78b1bccda71a8623785c9765a7adaec0071 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 12 May 2025 20:14:23 +0800 Subject: Have unencapsulated Expat headers in any condition The only condition where Expat headers would be encapsulated is when using LL's Autobuild-based prebuilt libraries, and we're never using any of LL's prebuilt binary for Expat on desktop, since Expat is practically available on any supported desktop platform. The system Expat headers are never encapsulated in any of those platforms. This is the beginning of not relying on the LL_USESYSTEMLIBS macro any more (eventually not relying on the custom USESYSTEMLIBS CMake setting either). Keeping the build system still flexible to have the option to use LL's prebuilt libraries *fully* (we still use some of them in cases where the platform may not have the related system library or for convenience, so the term USESYSTEMLIBS may not always be consistent), is getting harder to maintain. The way it's done is using #if 1, in order to minimise difference from upstream. --- indra/llcommon/llsdserialize_xml.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp index 6396caf8d5..ce416baa04 100644 --- a/indra/llcommon/llsdserialize_xml.cpp +++ b/indra/llcommon/llsdserialize_xml.cpp @@ -35,7 +35,7 @@ extern "C" { -#ifdef LL_USESYSTEMLIBS +#if 1 # include #else # include "expat/expat.h" -- cgit v1.2.3 From a5dcf2912463f14818370d649a8c418e16fb6ff0 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 12 May 2025 20:43:55 +0800 Subject: Not rely on LL_USESYSTEMLIBS for choosing zlib impl with the effect of choosing zlib over zlib-ng in any condition, which has been the case so far. But this opens the way to relying on some other condition, such as which platform, for deciding whether we can use zlib-ng or not, instead of zlib. So we can freely use, for example LL's prebuilt, zlib-ng while still using system libraries for others. --- indra/llcommon/llsdserialize.cpp | 2 +- indra/llcommon/llsys.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 37af366a20..68a7bf0adf 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -37,7 +37,7 @@ #include #include -#ifdef LL_USESYSTEMLIBS +#if 1 # include #else # include "zlib-ng/zlib.h" // for davep's dirty little zip functions diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 94d59adf29..5c35aeb476 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -33,7 +33,7 @@ #include "llsys.h" #include -#ifdef LL_USESYSTEMLIBS +#if 1 # include #else # include "zlib-ng/zlib.h" -- cgit v1.2.3 From d43c417a737d9f48fece51d084a85e3fad86382b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 12 May 2025 21:07:02 +0800 Subject: Similar to commit 2a57b9 but for xxHash --- indra/llcommon/hbxxh.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/hbxxh.cpp b/indra/llcommon/hbxxh.cpp index 8ccf8dfcbe..decf908bb6 100644 --- a/indra/llcommon/hbxxh.cpp +++ b/indra/llcommon/hbxxh.cpp @@ -34,11 +34,7 @@ // in your build, in which case the latter would be used instead. For ARM64 // builds, this would also automatically enable NEON vectorization. #define XXH_INLINE_ALL -#if LL_USESYSTEMLIBS #include -#else -#include "xxhash/xxhash.h" -#endif #include "hbxxh.h" -- cgit v1.2.3 From f5ab6e11f13699c03a696611f67f8384434130a1 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 13 May 2025 10:22:54 +0800 Subject: Not rely on (LL_)USESYSTEMLIBS macro & CMake setting but the fact that we keep on using as many system libraries as we can (and only resort to other sources in certain cases), hasn't changed, of course. Also stop having to set USE_AUTOBUILD_3P to OFF. Lines are reindented, and when a system library can be found for a dependency, then that should be the way. If later we find out that using some other way is better, than stick to that. So, one option at a time, whichever is best for the situation. GLEXT hasn't been used, and in order to be not having to hack its .cmake file, we bypass it and refer to GLH (which is still used) right away in LLWindow. CMake commands that need to be bypassed, if it's a one-liner then it's just commented out, but if it's multiple lines, then scope them with if (FALSE) to minimise difference. --- indra/llcommon/CMakeLists.txt | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 6aec3aada7..07f6eb95e0 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -8,9 +8,6 @@ include(bugsplat) include(Linking) include(Boost) include(LLSharedLibs) -if (NOT USESYSTEMLIBS) -include(Copy3rdPartyLibs) -endif () include(ZLIBNG) include(Tracy) @@ -306,23 +303,19 @@ if (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu) OR (${LIN target_include_directories(llcommon PUBLIC ${LIBS_PREBUILT_DIR}/include) endif () -if (NOT USESYSTEMLIBS) -add_dependencies(llcommon stage_third_party_libs) -else () - target_compile_options(${PROJECT_NAME} PUBLIC -Wno-deprecated-declarations) - if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set_source_files_properties( - llapp.cpp - llsdutil.cpp - PROPERTIES COMPILE_FLAGS -Wno-stringop-truncation) - set_source_files_properties( - llevent.cpp - llfasttimer.cpp - PROPERTIES COMPILE_FLAGS -Wno-nonnull) - elseif (LINUX AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set_source_files_properties(llsys.cpp PROPERTIES - COMPILE_FLAGS -Wno-unused-but-set-variable) - endif() +target_compile_options(${PROJECT_NAME} PUBLIC -Wno-deprecated-declarations) +if (CMAKE_CXX_COMPILER_ID MATCHES GNU) + set_source_files_properties( + llapp.cpp + llsdutil.cpp + PROPERTIES COMPILE_FLAGS -Wno-stringop-truncation) + set_source_files_properties( + llevent.cpp + llfasttimer.cpp + PROPERTIES COMPILE_FLAGS -Wno-nonnull) +elseif (LINUX AND CMAKE_CXX_COMPILER_ID MATCHES Clang) + set_source_files_properties(llsys.cpp PROPERTIES + COMPILE_FLAGS -Wno-unused-but-set-variable) endif () include(LibraryInstall) -- cgit v1.2.3 From 793bdbf972eca4c032813d6e2c4ef4e79d1628eb Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 13 May 2025 10:48:20 +0800 Subject: Empty CMake elses & endifs parentheses to make it more flexible the next time a value in the if's parentheses gets changed again, and also to reduce duplicate pattern matches when grepping those CMake files with certain keywords. --- indra/llcommon/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 07f6eb95e0..ac35bec368 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -293,11 +293,11 @@ if (CMAKE_OSX_ARCHITECTURES MATCHES arm64 OR CMAKE_SYSTEM_PROCESSOR MATCHES aarc https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h ${LIBS_PREBUILT_DIR}/include/sse2neon/sse2neon.h ) - endif (NOT EXISTS ${LIBS_PREBUILT_DIR}/include/sse2neon/sse2neon.h) + endif () file(WRITE ${PREBUILD_TRACKING_DIR}/sse2neon_installed "0") - endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/sse2neon_installed OR NOT ${sse2neon_installed} EQUAL 0) + endif () target_include_directories(llcommon PUBLIC ${LIBS_PREBUILT_DIR}/include/sse2neon) -endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64 OR CMAKE_SYSTEM_PROCESSOR MATCHES aarch64) +endif () if (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu) OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed)) target_include_directories(llcommon PUBLIC ${LIBS_PREBUILT_DIR}/include) -- cgit v1.2.3