diff options
48 files changed, 1131 insertions, 526 deletions
@@ -27,204 +27,55 @@ As a third party maintained fork, which includes Apple Silicon native builds, Me ## Build Instructions ``` +$ git clone git://megapahit.org/viewer.git $ cd viewer -$ git remote add megapahit git://megapahit.org/viewer.git -$ git fetch megapahit -$ git checkout megapahit/main -$ git switch -c megapahit +$ mkdir build-`uname -s|tr '[:upper:]' '[:lower:]'`-`uname -m` +$ cd build-`uname -s|tr '[:upper:]' '[:lower:]'`-`uname -m` ``` ### macOS ``` -$ sudo port install cmake pkgconfig freealut apr-util +universal boost181 +universal -no_static collada-dom +universal glm +universal hunspell +universal openjpeg +universal libsdl2 +universal uriparser +universal libvorbis +universal -$ mkdir -p build/universal-apple-darwin`uname -r`/packages -$ cd ~/Downloads -$ curl -OL https://github.com/secondlife/3p-curl/releases/download/v7.54.1-513145c/curl-7.54.1-513145c-darwin64-513145c.tar.zst -OL https://megapahit.net/downloads/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwinuniversal-233471337.tar.bz2 -OL https://github.com/secondlife/3p-emoji-shortcodes/releases/download/v6.1.0.5413f58/emoji_shortcodes-6.1.0.5413f58-darwin64-5413f58.tar.zst -OL https://github.com/secondlife/3p-glh_linear/releases/download/v1.0.1-dev4-984c397/glh_linear-1.0.1-dev4-common-984c397.tar.zst -OL https://github.com/secondlife/llca/releases/download/v202402012004.0-0f5d9c3/llca-202402012004.0-common-0f5d9c3.tar.zst -L https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.21.tar.gz -o meshoptimizer-0.21.tar.gz -OL https://github.com/secondlife/3p-mikktspace/releases/download/v2-e967e1b/mikktspace-1-darwin64-8756084692.tar.zst -OL https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/115452/994130/nanosvg-2022.09.27-darwin64-580364.tar.bz2 -OL https://github.com/secondlife/3p-libndofdev/releases/download/v0.1.8e9edc7/libndofdev-0.1.8e9edc7-darwin64-8e9edc7.tar.zst -L https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.2.tar.gz -o openjpeg-2.5.2.tar.gz -OL https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-darwin64-de53f55.tar.zst -OL https://github.com/secondlife/3p-tinyexr/releases/download/v1.0.8-ba4bc64/tinyexr-v1.0.8-common-9373975608.tar.zst -OL https://github.com/secondlife/3p-tinygltf/releases/download/v2.5.0-1ae57fd/tinygltf-v2.5.0-common-1ae57fd.tar.zst -OL https://github.com/secondlife/3p-viewer-fonts/releases/download/v1.0.0-r1/viewer_fonts-1.0.0.8512067490-common-8512067490.tar.zst -OL https://get.videolan.org/vlc/3.0.21/macosx/vlc-3.0.21-universal.dmg -OL https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.61/webrtc-m114.5735.08.61.9571920264-darwin64-9571920264.tar.zst -OL https://github.com/crow-misia/libwebrtc-bin/releases/download/114.5735.6.1/libwebrtc-macos-arm64.tar.xz -OL https://sourceforge.net/projects/xmlrpc-epi/files/xmlrpc-epi-base/0.54.2/xmlrpc-epi-0.54.2.tar.bz2 -$ cd - -$ cd .. -$ open ~/Downloads/vlc-3.0.21-universal.dmg -$ tar xf ~/Downloads/meshoptimizer-0.21.tar.gz -$ tar xf ~/Downloads/openjpeg-2.5.2.tar.gz -$ tar xf ~/Downloads/libwebrtc-macos-arm64.tar.xz -$ tar xf ~/Downloads/xmlrpc-epi-0.54.2.tar.bz2 -$ git clone https://github.com/secondlife/3p-openssl -$ git clone https://github.com/secondlife/3p-curl -$ git clone https://github.com/secondlife/3p-libndofdev -$ cd meshoptimizer-0.21 -$ mkdir -p build/universal-apple-darwin`uname -r` -$ cd build/universal-apple-darwin`uname -r` -$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES:STRING="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=12.0 -DMESHOPT_BUILD_SHARED_LIBS:BOOL=ON ../.. -$ make -j`sysctl -n hw.ncpu` -$ sudo make install -$ cd ../../../openjpeg-2.5.2 -$ sudo cp src/lib/openjp2/cio.h src/lib/openjp2/event.h /opt/local/include/openjpeg-2.5/ -$ mkdir -p build/`uname -m`-apple-darwin`uname -r` -$ cd build/`uname -m`-apple-darwin`uname -r` -$ cmake -DCMAKE_BUILD_TYPE:STRING=Release ../.. -$ sudo cp src/lib/openjp2/opj_config_private.h /opt/local/include/openjpeg-2.5/ -$ cd ../../../xmlrpc-epi-0.54.2 -$ export CPPFLAGS="$CPPFLAGS -I$PWD/src" -$ rm -f config.sub missing -$ autoreconf -is -$ mkdir -p build/x86_64-apple-darwin`uname -r` -$ cd build/x86_64-apple-darwin`uname -r` -$ export CFLAGS="-arch x86_64" -$ ../../configure --host=x86_64-apple-darwin`uname -r` -$ make -j`sysctl -n hw.ncpu` -$ sudo make install -$ cd - -$ sed -i '' -e 's/XMLRPC_VALUE find_named_value/__attribute__((always_inline)) XMLRPC_VALUE find_named_value/g' src/xmlrpc_introspection.c -$ sed -i '' -e 's/void describe_method/__attribute__((always_inline)) void describe_method/g' src/xmlrpc_introspection.c -$ mkdir -p build/aarch64-apple-darwin`uname -r` -$ cd build/aarch64-apple-darwin`uname -r` -$ export CFLAGS="-arch arm64" -$ ../../configure --host=aarch64-apple-darwin`uname -r` -$ make -j`sysctl -n hw.ncpu` -$ sudo lipo src/.libs/libxmlrpc-epi.a /usr/local/lib/libxmlrpc-epi.a -create -output /usr/local/lib/libxmlrpc-epi.a -$ sudo lipo src/.libs/libxmlrpc-epi.0.dylib /usr/local/lib/libxmlrpc-epi.0.dylib -create -output /usr/local/lib/libxmlrpc-epi.0.dylib -$ unset CPPFLAGS CFLAGS -$ cd ../../../../3p-openssl/openssl -$ mkdir -p build/aarch64-apple-darwin`uname -r` -$ cd build/aarch64-apple-darwin`uname -r` -$ ../../Configure no-shared darwin64-arm64-cc -$ make -j`sysctl -n hw.ncpu` -$ cd ../../../../3p-curl/curl -$ mkdir -p build/aarch64-apple-darwin`uname -r` -$ cd build/aarch64-apple-darwin`uname -r` -$ export CFLAGS="-arch arm64 -mmacosx-version-min=11.0 -std=c90" -$ sudo port deactivate openssl3 -$ ../../configure --host=aarch64-apple-darwin`uname -r` --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=/opt/local/libexec/openssl11 --without-libidn2 --without-libpsl -$ make -j`sysctl -n hw.ncpu` -$ sudo port activate openssl3 -$ unset CFLAGS -$ cd ../../../../3p-libndofdev/libndofdev -$ mkdir -p build/aarch64-apple-darwin`uname -r` -$ cd build/aarch64-apple-darwin`uname -r` -$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES:STRING=arm64 -DCMAKE_C_FLAGS:STRING=-DTARGET_OS_MAC ../.. -$ make -j`sysctl -n hw.ncpu` -$ cd ../../../../viewer/indra/newview -$ tar xf ~/Downloads/viewer_fonts-1.0.0.8512067490-common-8512067490.tar.zst -$ cd ../../build/universal-apple-darwin`uname -r`/packages -$ tar xf ~/Downloads/curl-7.54.1-513145c-darwin64-513145c.tar.zst -$ tar xf ~/Downloads/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwinuniversal-233471337.tar.bz2 -$ tar xf ~/Downloads/emoji_shortcodes-6.1.0.5413f58-darwin64-5413f58.tar.zst -$ tar xf ~/Downloads/glh_linear-1.0.1-dev4-common-984c397.tar.zst -$ tar xf ~/Downloads/llca-202402012004.0-common-0f5d9c3.tar.zst -$ tar xf ~/Downloads/mikktspace-1-darwin64-8756084692.tar.zst -$ tar xf ~/Downloads/nanosvg-2022.09.27-darwin64-580364.tar.bz2 -$ tar xf ~/Downloads/libndofdev-0.1.8e9edc7-darwin64-8e9edc7.tar.zst -$ tar xf ~/Downloads/openssl-1.1.1q.de53f55-darwin64-de53f55.tar.zst -$ tar xf ~/Downloads/tinyexr-v1.0.8-common-9373975608.tar.zst -$ tar xf ~/Downloads/tinygltf-v2.5.0-common-1ae57fd.tar.zst -$ tar xf ~/Downloads/webrtc-m114.5735.08.61.9571920264-darwin64-9571920264.tar.zst -$ cd lib/release -$ lipo ../../../../../../3p-openssl/openssl/build/aarch64-apple-darwin`uname -r`/libcrypto.a libcrypto.a -create -output libcrypto.a -$ lipo ../../../../../../3p-openssl/openssl/build/aarch64-apple-darwin`uname -r`/libssl.a libssl.a -create -output libssl.a -$ lipo ../../../../../../3p-curl/curl/build/aarch64-apple-darwin`uname -r`/lib/.libs/libcurl.a libcurl.a -create -output libcurl.a -$ lipo ../../../../../../3p-libndofdev/libndofdev/build/aarch64-apple-darwin`uname -r`/src/libndofdev.dylib libndofdev.dylib -create -output libndofdev.dylib -$ lipo ../../../../../../libwebrtc-macos-arm64/lib/libwebrtc.a libwebrtc.a -create -output libwebrtc.a -$ cd WebRTC.framework/Versions/A -$ lipo ../../../../../../../../../libwebrtc-macos-arm64/Frameworks/WebRTC.xcframework/macos-arm64/WebRTC.framework/Versions/A/WebRTC WebRTC -create -output WebRTC -$ cd ../../../../../.. -$ cd /opt/local/include -$ sudo curl -OL https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h -$ cd - -$ export LL_BUILD="-O3 -gdwarf-2 -stdlib=libc++ -iwithsysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -std=c++17 -fPIC -DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -DNDEBUG -DPIC -DLL_DARWIN=1" -$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=newview/Megapahit.app/Contents/Resources -DCMAKE_OSX_ARCHITECTURES:STRING="arm64;x86_64" -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=OFF ../../indra -$ cmake ../../indra +$ sudo port install cmake pkgconfig autoconf automake libtool freealut +universal apr-util +universal boost181 +universal -no_static collada-dom +universal glm hunspell +universal freetype +universal openjpeg +universal uriparser +universal libvorbis +universal xxhashlib +$ export LL_BUILD="-O3 -gdwarf-2 -stdlib=libc++ -mmacosx-version-min=10.15 -iwithsysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -std=c++17 -fPIC -DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -DNDEBUG -DPIC -DLL_DARWIN=1" +$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DROOT_PROJECT_NAME:STRING=Megapahit -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=newview/Megapahit.app/Contents/Resources -DCMAKE_OSX_ARCHITECTURES:STRING=`uname -m` ../indra +$ sudo port deactivate boost $ make -j`sysctl -n hw.ncpu` +$ sudo port activate boost $ make install $ open newview/Megapahit.app ``` -### GNU/Linux +### Debian ``` -$ mkdir -p build/`uname -m`-linux-gnu/packages -$ cd ~/Downloads -$ curl -OL https://github.com/secondlife/3p-curl/releases/download/v7.54.1-513145c/curl-7.54.1-513145c-linux64-513145c.tar.zst -OL https://github.com/secondlife/dullahan/releases/download/v1.14.0-r2/dullahan-1.14.0.202404051708_118.4.1_g3dd6078_chromium-118.0.5993.54-linux64-8573290624.tar.zst -OL https://github.com/secondlife/3p-emoji-shortcodes/releases/download/v6.1.0.5413f58/emoji_shortcodes-6.1.0.5413f58-linux64-5413f58.tar.zst -OL https://github.com/secondlife/3p-glh_linear/releases/download/v1.0.1-dev4-984c397/glh_linear-1.0.1-dev4-common-984c397.tar.zst -OL https://github.com/secondlife/3p-glm/releases/download/v1.0.1-r1/glm-v1.0.1-common-9066386153.tar.zst -OL https://github.com/secondlife/llca/releases/download/v202402012004.0-0f5d9c3/llca-202402012004.0-common-0f5d9c3.tar.zst -OL https://github.com/secondlife/3p-mikktspace/releases/download/v2-e967e1b/mikktspace-1-linux64-8756084692.tar.zst -OL https://github.com/secondlife/3p-open-libndofdev/releases/download/v1.14-r2/open_libndofdev-0.14.8730039102-linux64-8730039102.tar.zst -OL https://github.com/uclouvain/openjpeg/releases/download/v2.5.2/openjpeg-v2.5.2-linux-x86_64.tar.gz -L https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.2.tar.gz -o openjpeg-2.5.2.tar.gz -OL https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-linux64-de53f55.tar.zst -OL https://github.com/secondlife/3p-tinyexr/releases/download/v1.0.8-ba4bc64/tinyexr-v1.0.8-common-9373975608.tar.zst -OL https://github.com/secondlife/3p-tinygltf/releases/download/v2.5.0-1ae57fd/tinygltf-v2.5.0-common-1ae57fd.tar.zst -OL https://github.com/secondlife/3p-viewer-fonts/releases/download/v1.0.0-r1/viewer_fonts-1.0.0.8512067490-common-8512067490.tar.zst -OL https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.61/webrtc-m114.5735.08.61.9571920264-linux64-9571920264.tar.zst -$ cd - -$ cd indra/newview -$ tar xf ~/Downloads/viewer_fonts-1.0.0.8512067490-common-8512067490.tar.zst -$ cd ../../build/`uname -m`-linux-gnu/packages -$ tar xf ~/Downloads/curl-7.54.1-513145c-linux64-513145c.tar.zst -$ tar xf ~/Downloads/dullahan-1.14.0.202404051708_118.4.1_g3dd6078_chromium-118.0.5993.54-linux64-8573290624.tar.zst -$ tar xf ~/Downloads/emoji_shortcodes-6.1.0.5413f58-linux64-5413f58.tar.zst -$ tar xf ~/Downloads/glh_linear-1.0.1-dev4-common-984c397.tar.zst -$ tar xf ~/Downloads/glm-v1.0.1-common-9066386153.tar.zst -$ tar xf ~/Downloads/llca-202402012004.0-common-0f5d9c3.tar.zst -$ tar xf ~/Downloads/mikktspace-1-linux64-8756084692.tar.zst -$ tar xf ~/Downloads/open_libndofdev-0.14.8730039102-linux64-8730039102.tar.zst -$ tar xf ~/Downloads/openssl-1.1.1q.de53f55-linux64-de53f55.tar.zst -$ tar xf ~/Downloads/tinyexr-v1.0.8-common-9373975608.tar.zst -$ tar xf ~/Downloads/tinygltf-v2.5.0-common-1ae57fd.tar.zst -$ tar xf ~/Downloads/webrtc-m114.5735.08.61.9571920264-linux64-9571920264.tar.zst -$ cd ../../../.. -$ tar xf ~/Downloads/openjpeg-v2.5.2-linux-x86_64.tar.gz -$ cp -R openjpeg-v2.5.2-linux-x86_64/include/openjpeg-2.5 viewer/build/`uname -m`-linux-gnu/packages/include/openjpeg -$ cp openjpeg-v2.5.2-linux-x86_64/lib/libopenjp2.a viewer/build/`uname -m`-linux-gnu/packages/lib/release/ -$ tar xf ~/Downloads/openjpeg-2.5.2.tar.gz -$ cd openjpeg-2.5.2 -$ cp src/lib/openjp2/cio.h src/lib/openjp2/event.h ../viewer/build/`uname -m`-linux-gnu/packages/include/openjpeg/ -$ mkdir -p build/`uname -m`-linux-gnu -$ cd build/`uname -m`-linux-gnu -$ cmake -DCMAKE_BUILD_TYPE:STRING=Release ../.. -$ cp src/lib/openjp2/opj_config_private.h ../../../viewer/build/`uname -m`-linux-gnu/packages/include/openjpeg/ -$ cd ../../../viewer/build/`uname -m`-linux-gnu +$ sudo apt install pkg-config libalut-dev libaprutil1-dev libboost-fiber1.81-dev libboost-json1.81-dev libboost-program-options1.81-dev libboost-regex1.81-dev libcollada-dom-dev libexpat1-dev libfltk1.3-dev libglu1-mesa-dev libhunspell-dev libmeshoptimizer-dev libnghttp2-dev libpipewire-0.3-dev libsdl2-dev liburiparser-dev libvlc-dev libvlccore-dev libvorbis-dev libxmlrpc-epi-dev libxxhash-dev $ export LL_BUILD="-O3 -std=c++17 -fPIC -DLL_LINUX=1" -$ rm CMakeCache.txt -``` - -#### Debian 12.5 - -``` -$ cd ~/Downloads -$ curl -OL https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/115397/993664/nanosvg-2022.09.27-linux-580337.tar.bz2 -$ cd - -$ cd packages -$ tar xf ~/Downloads/nanosvg-2022.09.27-linux-580337.tar.bz2 -$ cd .. -$ sudo apt install pkg-config libalut-dev libaprutil1-dev libboost-fiber1.81-dev libboost-json1.81-dev libboost-program-options1.81-dev libboost-regex1.81-dev libcollada-dom-dev libexpat1-dev libfltk1.3-dev libfontconfig-dev libfreetype-dev libglu1-mesa-dev libhunspell-dev libjpeg-dev libmeshoptimizer-dev libnghttp2-dev libpng-dev libpipewire-0.3-dev libsdl2-dev liburiparser-dev libvlc-dev libvlccore-dev libvorbis-dev libxft-dev libxmlrpc-epi-dev libxxhash-dev -$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON -DCPACK_PACKAGE_NAME:STRING=megapahit -DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF -DCPACK_BINARY_DEB:BOOL=ON -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE:STRING=amd64 -DCPACK_DEBIAN_PACKAGE_DESCRIPTION:STRING="A fork of the Second Life viewer" -DCPACK_DEBIAN_PACKAGE_MAINTAINER:STRING=$USER@$HOST -DCPACK_DEBIAN_PACKAGE_SECTION:STRING=net -DCPACK_DEBIAN_PACKAGE_DEPENDES:STRING="libalut0, libaprutil1, libboost-fiber1.81.0, libboost-program-options1.81.0, libboost-regex1.81.0, libboost-thread1.81.0, libcollada-dom2.5-dp0, libexpat1, libfltk1.3, libglu1-mesa, libhunspell-1.7-0, libmeshoptimizer2d (>= 0.18), libnghttp2-14, libsdl2-2.0-0, liburiparser1, libvlc5, libvorbisenc2, libvorbisfile3, libxmlrpc-epi0, vlc-plugin-base" ../../indra -$ cmake ../../indra +$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DROOT_PROJECT_NAME:STRING=Megapahit -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../indra $ make -j`nproc` $ cpack -G DEB $ sudo apt install megapahit-`cat newview/viewer_version.txt`-Linux.deb $ megapahit ``` -#### Ubuntu 24.04 +### Ubuntu ``` $ sudo apt install pkg-config libalut-dev libaprutil1-dev libboost-fiber-dev libboost-json-dev libboost-program-options-dev libboost-regex-dev libcollada-dom-dev libexpat1-dev libfltk1.3-dev libglu1-mesa-dev libhunspell-dev libmeshoptimizer-dev libnanosvg-dev libnghttp2-dev libpipewire-0.3-dev libsdl2-dev liburiparser-dev libvlc-dev libvlccore-dev libvorbis-dev libxmlrpc-epi-dev libxxhash-dev -$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON -DCPACK_PACKAGE_NAME:STRING=megapahit -DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF -DCPACK_BINARY_DEB:BOOL=ON -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE:STRING=amd64 -DCPACK_DEBIAN_PACKAGE_DESCRIPTION:STRING="A fork of the Second Life viewer" -DCPACK_DEBIAN_PACKAGE_MAINTAINER:STRING=$USER@$HOST -DCPACK_DEBIAN_PACKAGE_SECTION:STRING=net -DCPACK_DEBIAN_PACKAGE_DEPENDES:STRING="libalut0, libaprutil1t64, libboost-fiber1.83.0, libboost-program-options1.83.0, libboost-regex1.83.0, libboost-thread1.83.0, libcollada-dom2.5-dp0, libexpat1, libfltk2.0-0t64, libglu1-mesa, libhunspell-1.7-0, libmeshoptimizer2d, libnghttp2-14, libsdl2-2.0-0, liburiparser1, libvlc5, libvorbisenc2, libvorbisfile3, libxmlrpc-epi0t64, vlc-plugin-base" ../../indra -$ cmake ../../indra +$ export LL_BUILD="-O3 -std=c++17 -fPIC -DLL_LINUX=1" +$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DROOT_PROJECT_NAME:STRING=Megapahit -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../indra $ make -j`nproc` $ cpack -G DEB $ sudo apt install megapahit-`cat newview/viewer_version.txt`-Linux.deb $ megapahit ``` -#### Fedora +### Fedora ``` -$ cd ~/Downloads -$ curl -L https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.21.tar.gz -o meshoptimizer-0.21.tar.gz -$ cd - -$ cd ../../.. -$ tar xf ~/Downloads/meshoptimizer-0.21.tar.gz -$ cd meshoptimizer-0.21 -$ mkdir -p build/`uname -m`-linux-gnu -$ cd build/`uname -m`-linux-gnu -$ cmake -DCMAKE_BUILD_TYPE:STRING=Release ../.. -$ make -j`nproc` -$ sudo make install -$ cd ../../../viewer/build/`uname -m`-linux-gnu -$ sudo dnf install gcc-c++ patchelf freealut-devel apr-util-devel boost-devel collada-dom-devel expat-devel fltk-devel mesa-libGLU-devel hunspell-devel libnghttp2-devel nanosvg-devel pipewire-devel pulseaudio-libs-devel SDL2-devel uriparser-devel vlc-devel libvorbis-devel xmlrpc-epi-devel xxhash-devel -$ patchelf --remove-rpath packages/bin/release/dullahan_host -$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON -DCPACK_PACKAGE_NAME:STRING=megapahit -DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=ON -DCPACK_RPM_PACKAGE_SUMMARY:STRING="A fork of the Second Life viewer" -DCPACK_RPM_PACKAGE_ARCHITECTURE:STRING=`uname -m` -DCPACK_RPM_PACKAGE_LICENSE:STRING=LGPL-2.1-only -DCPACK_RPM_PACKAGE_VENDOR:STRING=Megapahit -DCPACK_RPM_PACKAGE_URL:STRING=https://megapahit.net -DCPACK_RPM_PACKAGE_DESCRIPTION:STRING="An entrance to virtual empires in only megabytes. A shelter for the metaverse refugees, especially those from less supported operating systems." -DCPACK_RPM_PACKAGE_REQUIRES:STRING="freealut, apr-util, boost-fiber, boost-program-options, boost-regex, boost-thread, collada-dom, expat, fltk, mesa-libGLU, hunspell, libnghttp2, SDL2, uriparser, vlc-libs, vlc-plugins-base, libvorbis, xmlrpc-epi" ../../indra -$ cmake ../../indra +$ sudo dnf install gcc-c++ patchelf freealut-devel apr-util-devel boost-devel collada-dom-devel expat-devel fltk-devel mesa-libGLU-devel hunspell-devel libnghttp2-devel nanosvg-devel openjpeg-devel pipewire-devel pulseaudio-libs-devel SDL2-devel uriparser-devel vlc-devel libvorbis-devel xmlrpc-epi-devel xxhash-devel +$ export LL_BUILD="-O3 -std=c++17 -fPIC -DLL_LINUX=1" +$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=OFF -DUSE_FMODSTUDIO:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DROOT_PROJECT_NAME:STRING=Megapahit -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../indra $ make -j`nproc` $ cpack -G RPM $ sudo rpm -i megapahit-`cat newview/viewer_version.txt`-Linux.rpm @@ -234,37 +85,11 @@ $ megapahit ### FreeBSD ``` -$ mkdir -p build/`uname -m`-unknown-freebsd14.1/packages -$ cd ~/Downloads -$ curl -OL https://github.com/secondlife/3p-emoji-shortcodes/releases/download/v6.1.0.5413f58/emoji_shortcodes-6.1.0.5413f58-linux64-5413f58.tar.zst -OL https://github.com/secondlife/3p-glh_linear/releases/download/v1.0.1-dev4-984c397/glh_linear-1.0.1-dev4-common-984c397.tar.zst -OL https://github.com/secondlife/llca/releases/download/v202402012004.0-0f5d9c3/llca-202402012004.0-common-0f5d9c3.tar.zst -OL https://github.com/secondlife/3p-mikktspace/releases/download/v2-e967e1b/mikktspace-1-linux64-8756084692.tar.zst -OL https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-linux64-de53f55.tar.zst -OL https://github.com/secondlife/3p-tinyexr/releases/download/v1.0.8-ba4bc64/tinyexr-v1.0.8-common-9373975608.tar.zst -OL https://github.com/secondlife/3p-tinygltf/releases/download/v2.5.0-1ae57fd/tinygltf-v2.5.0-common-1ae57fd.tar.zst -OL https://github.com/secondlife/3p-viewer-fonts/releases/download/v1.0.0-r1/viewer_fonts-1.0.0.8512067490-common-8512067490.tar.zst -$ cd - -$ cd .. -$ git clone https://github.com/secondlife/3p-openssl -$ git clone https://github.com/secondlife/3p-curl -$ cd 3p-openssl/openssl -$ mkdir -p build/`uname -m`-unknown-freebsd14.1 -$ cd -p build/`uname -m`-unknown-freebsd14.1 -$ ../../config no-shared -$ make -j`nproc` -$ cd ../../../../viewer/indra/newview -$ tar xf ~/Downloads/viewer_fonts-1.0.0.8512067490-common-8512067490.tar.zst -$ cd ../../build/`uname -m`-unknown-freebsd14.1/packages -$ tar xf ~/Downloads/emoji_shortcodes-6.1.0.5413f58-linux64-5413f58.tar.zst -$ tar xf ~/Downloads/glh_linear-1.0.1-dev4-common-984c397.tar.zst -$ tar xf ~/Downloads/llca-202402012004.0-common-0f5d9c3.tar.zst -$ tar xf ~/Downloads/mikktspace-1-linux64-8756084692.tar.zst -$ tar xf ~/Downloads/openssl-1.1.1q.de53f55-linux64-de53f55.tar.zst -$ tar xf ~/Downloads/tinyexr-v1.0.8-common-9373975608.tar.zst -$ tar xf ~/Downloads/tinygltf-v2.5.0-common-1ae57fd.tar.zst -$ cp ../../../../3p-openssl/openssl/build/`uname -m`-unknown-freebsd14.1/lib*.a lib/release/ -$ cd .. $ setenv LL_BUILD "-O3 -std=c++17 -fPIC" $ sudo su - # portmaster devel/cmake devel/pkgconf audio/freealut devel/apr1 devel/collada-dom x11-toolkits/fltk math/glm textproc/hunspell misc/meshoptimizer graphics/nanosvg graphics/openjpeg devel/sdl20 net/uriparser multimedia/vlc audio/libvorbis net/xmlrpc-epi devel/xxhash # exit -$ rm CMakeCache.txt -$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=OFF -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON -DCPACK_PACKAGE_NAME:STRING=megapahit -DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF -DCPACK_BINARY_FREEBSD:BOOL=ON -DCPACK_FREEBSD_PACKAGE_COMMENT:STRING="A fork of the Second Life viewer" -DCPACK_FREEBSD_PACKAGE_DESCRIPTION:STRING="An entrance to virtual empires in only megabytes. A shelter for the metaverse refugees, especially those from less supported operating systems." -DCPACK_FREEBSD_PACKAGE_WWW:STRING=https://megapahit.net -DCPACK_FREEBSD_PACKAGE_LICENSE:STRING=LGPL21 -DCPACK_FREEBSD_PACKAGE_MAINTAINER:STRING=$USER@$HOST -DCPACK_FREEBSD_PACKAGE_ORIGIN:STRING=net/megapahit -DCPACK_FREEBSD_PACKAGE_DEPS:STRING="audio/freealut;devel/collada-dom;graphics/libGLU;textproc/hunspell;misc/meshoptimizer;www/libnghttp2;graphics/openjpeg;net/uriparser;multimedia/vlc;audio/libvorbis;net/xmlrpc-epi" ../../indra -$ cmake ../../indra +$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DUSE_FMODSTUDIO:BOOL=OFF -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=OFF -DROOT_PROJECT_NAME:STRING=Megapahit -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../indra $ make -j`nproc` $ sudo cpack -G FREEBSD $ sudo pkg add megapahit-`cat newview/viewer_version.txt`-FreeBSD.pkg diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index a1eed8e989..e7e41fd316 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -12,7 +12,7 @@ # "if(${CMAKE_VERSION} VERSION_LESS "3.20.0")" that can also be removed cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR) -set(ROOT_PROJECT_NAME "Megapahit" CACHE STRING +set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING "The root project/makefile/solution name. Defaults to SecondLife.") project(${ROOT_PROJECT_NAME}) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index c499807d75..a4f81917ea 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -9,19 +9,30 @@ if( USE_CONAN ) target_compile_definitions( ll::boost INTERFACE BOOST_ALLOW_DEPRECATED_HEADERS BOOST_BIND_GLOBAL_PLACEHOLDERS ) return() elseif( NOT USE_AUTOBUILD_3P ) - find_package( Boost REQUIRED ) - target_compile_definitions( ll::boost INTERFACE BOOST_BIND_GLOBAL_PLACEHOLDERS ) if (DARWIN) - set(sfx "-mt") - endif() - target_link_libraries( ll::boost INTERFACE - boost_context${sfx} - boost_fiber${sfx} - boost_filesystem${sfx} - boost_program_options${sfx} - boost_regex${sfx} - boost_system${sfx} - boost_thread${sfx}) + target_include_directories( ll::boost SYSTEM INTERFACE /opt/local/libexec/boost/1.81/include) + target_link_libraries( ll::boost INTERFACE + /opt/local/libexec/boost/1.81/lib/libboost_context-mt.a + /opt/local/libexec/boost/1.81/lib/libboost_fiber-mt.a + /opt/local/libexec/boost/1.81/lib/libboost_filesystem-mt.a + /opt/local/libexec/boost/1.81/lib/libboost_program_options-mt.a + /opt/local/libexec/boost/1.81/lib/libboost_regex-mt.a + /opt/local/libexec/boost/1.81/lib/libboost_system-mt.a + /opt/local/libexec/boost/1.81/lib/libboost_thread-mt.a + ) + else (DARWIN) + find_package( Boost REQUIRED ) + target_link_libraries( ll::boost INTERFACE + boost_context + boost_fiber + boost_filesystem + boost_program_options + boost_regex + boost_system + boost_thread + ) + endif (DARWIN) + target_compile_definitions( ll::boost INTERFACE BOOST_BIND_GLOBAL_PLACEHOLDERS ) return() endif() diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index 3b09cc4321..aa151bafc8 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -55,10 +55,4 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n "LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}" "LLBUILD_CONFIG=\"${CMAKE_BUILD_TYPE}\"" ) -if (PACKAGE) - include(CPack) - set(CPACK_PACKAGE_VERSION - ${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION} - CACHE STRING "Viewer major.minor.patch.revision versions.") -endif (PACKAGE) endif (NOT DEFINED VIEWER_SHORT_VERSION) diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 7b0a945bc4..119a41f570 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -5,8 +5,47 @@ include(Prebuilt) include_guard() add_library( ll::cef INTERFACE IMPORTED ) -#use_prebuilt_binary(dullahan) -target_include_directories( ll::cef SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ${LIBS_PREBUILT_DIR}/include/cef) +if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/dullahan_installed OR NOT ${dullahan_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwin64-242070244.tar.bz2) + file(DOWNLOAD + https://megapahit.net/downloads/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwin64-242070244.tar.bz2 + ${CMAKE_BINARY_DIR}/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwin64-242070244.tar.bz2 + SHOW_PROGRESS + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwin64-242070244.tar.bz2) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwin64-242070244.tar.bz2 + DESTINATION ${LIBS_PREBUILT_DIR} + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/dullahan_installed "0") + endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/dullahan_installed OR NOT ${dullahan_installed} EQUAL 0) +elseif (CMAKE_OSX_ARCHITECTURES MATCHES x86_64) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/dullahan_installed OR NOT ${dullahan_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwin64-242070158.tar.bz2) + file(DOWNLOAD + https://megapahit.net/downloads/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwin64-242070158.tar.bz2 + ${CMAKE_BINARY_DIR}/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwin64-242070158.tar.bz2 + SHOW_PROGRESS + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwin64-242070158.tar.bz2) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwin64-242070158.tar.bz2 + DESTINATION ${LIBS_PREBUILT_DIR} + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/dullahan_installed "0") + endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/dullahan_installed OR NOT ${dullahan_installed} EQUAL 0) +else (CMAKE_OSX_ARCHITECTURES MATCHES arm64) +use_prebuilt_binary(dullahan) + if (${LINUX_DISTRO} MATCHES fedora) + execute_process( + COMMAND patchelf --remove-rpath bin/release/dullahan_host + WORKING_DIRECTORY ${LIBS_PREBUILT_DIR} + ) + endif (${LINUX_DISTRO} MATCHES fedora) +endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + +target_include_directories( ll::cef SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/cef) if (WINDOWS) target_link_libraries( ll::cef INTERFACE diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index d47e2a765c..60b74d3727 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -4,8 +4,102 @@ include(Prebuilt) include_guard() add_library( ll::libcurl INTERFACE IMPORTED ) -#use_system_binary(libcurl) -#use_prebuilt_binary(curl) +if (NOT USESYSTEMLIBS) +use_system_binary(libcurl) +endif (NOT USESYSTEMLIBS) +if (LINUX OR NOT USESYSTEMLIBS) +use_prebuilt_binary(curl) +elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/curl_installed OR NOT ${curl_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1.tar.gz) + file(DOWNLOAD + https://github.com/secondlife/3p-curl/archive/refs/tags/v7.54.1-r1.tar.gz + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1.tar.gz + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1.tar.gz) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1.tar.gz + DESTINATION ${CMAKE_BINARY_DIR} + ) + file( + COPY + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/include/curl/curl.h + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/include/curl/curlbuild.h + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/include/curl/curlrules.h + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/include/curl/curlver.h + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/include/curl/easy.h + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/include/curl/mprintf.h + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/include/curl/multi.h + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/include/curl/stdcheaders.h + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/include/curl/system.h + ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/include/curl/typecheck-gcc.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/curl + ) + file( + COPY + ${LIBS_PREBUILT_DIR}/lib/release/libcrypto.a + ${LIBS_PREBUILT_DIR}/lib/release/libssl.a + DESTINATION ${LIBS_PREBUILT_DIR}/lib + ) + message("We need to temporarily have OpenSSL3 header directory and libraries renamed just until the libcurl building process with OpenSSL1.1 now is finished.") + if (DARWIN) + set(ENV{CFLAGS} "-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.15 -std=c90") + execute_process(COMMAND sudo mv /opt/local/include/openssl /opt/local/include/openssl3) + execute_process(COMMAND sudo mv /opt/local/lib/libcrypto.a /opt/local/lib/libcrypto.a.3) + execute_process(COMMAND sudo mv /opt/local/lib/libcrypto.dylib /opt/local/lib/libcrypto.dylib.3) + execute_process(COMMAND sudo mv /opt/local/lib/libssl.a /opt/local/lib/libssl.a.3) + execute_process(COMMAND sudo mv /opt/local/lib/libssl.dylib /opt/local/lib/libssl.dylib.3) + if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + execute_process( + COMMAND ./configure --host=aarch64-apple-darwin --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl --without-libssh2 + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl + ) + else (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + execute_process( + COMMAND ./configure --host=${CMAKE_OSX_ARCHITECTURES}-apple-darwin --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl --without-libssh2 + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl + ) + endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + else (DARWIN) + execute_process(COMMAND sudo mv /usr/include/openssl /usr/include/openssl3) + execute_process(COMMAND sudo mv /usr/lib/libcrypto.a /usr/lib/libcrypto.a.3) + execute_process(COMMAND sudo mv /usr/lib/libcrypto.so /usr/lib/libcrypto.so.3) + execute_process(COMMAND sudo mv /usr/lib/libssl.a /usr/lib/libssl.a.3) + execute_process(COMMAND sudo mv /usr/lib/libssl.so /usr/lib/libssl.so.3) + execute_process( + COMMAND ./configure --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl --without-libssh2 + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl + ) + endif (DARWIN) + execute_process( + COMMAND make -j${MAKE_JOBS} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl + RESULT_VARIABLE curl_installed + ) + file( + COPY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/lib/.libs/libcurl.a + DESTINATION ${LIBS_PREBUILT_DIR}/lib/release + ) + if (DARWIN) + unset(ENV{CFLAGS}) + execute_process(COMMAND sudo mv /opt/local/include/openssl3 /opt/local/include/openssl) + execute_process(COMMAND sudo mv /opt/local/lib/libcrypto.a.3 /opt/local/lib/libcrypto.a) + execute_process(COMMAND sudo mv /opt/local/lib/libcrypto.dylib.3 /opt/local/lib/libcrypto.dylib) + execute_process(COMMAND sudo mv /opt/local/lib/libssl.a.3 /opt/local/lib/libssl.a) + execute_process(COMMAND sudo mv /opt/local/lib/libssl.dylib.3 /opt/local/lib/libssl.dylib) + else (DARWIN) + execute_process(COMMAND sudo mv /usr/include/openssl3 /usr/include/openssl) + execute_process(COMMAND sudo mv /usr/lib/libcrypto.a.3 /usr/lib/libcrypto.a) + execute_process(COMMAND sudo mv /usr/lib/libcrypto.so.3 /usr/lib/libcrypto.so) + execute_process(COMMAND sudo mv /usr/lib/libssl.a.3 /usr/lib/libssl.a) + execute_process(COMMAND sudo mv /usr/lib/libssl.so.3 /usr/lib/libssl.so) + endif (DARWIN) + message("OpenSSL3 header directory and library names have been restored.") + file(REMOVE + ${LIBS_PREBUILT_DIR}/lib/libcrypto.a + ${LIBS_PREBUILT_DIR}/lib/libssl.a + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/curl_installed "${curl_installed}") +endif (LINUX OR NOT USESYSTEMLIBS) if (WINDOWS) target_link_libraries(ll::libcurl INTERFACE libcurl.lib) else (WINDOWS) diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index 38437b7bfb..313ee2cde7 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -30,9 +30,68 @@ if (USE_FMODSTUDIO) # Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL) # as accessing the private LL location will fail if you don't have the credential include(Prebuilt) - if (NOT USESYSTEMLIBS) + if (USESYSTEMLIBS AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/fmodstudio_installed OR NOT ${fmodstudio_installed} EQUAL 0)) + file(MAKE_DIRECTORY ${LIBS_PREBUILT_DIR}/lib/release) + if (DARWIN) + execute_process( + COMMAND hdiutil attach -noverify fmodstudioapi20223mac-installer.dmg + WORKING_DIRECTORY $ENV{HOME}/Downloads + ) + file( + COPY + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod.hpp + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_codec.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_common.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_dsp.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_dsp_effects.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_errors.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_output.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/fmodstudio + ) + execute_process( + COMMAND lipo + lib/libfmod.dylib + -thin ${CMAKE_OSX_ARCHITECTURES} + -output ${LIBS_PREBUILT_DIR}/lib/release/libfmod.dylib + WORKING_DIRECTORY /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core + ) + execute_process( + COMMAND hdiutil detach FMOD\ Programmers\ API\ Mac + WORKING_DIRECTORY /Volumes + RESULT_VARIABLE fmodstudio_installed + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/fmodstudio_installed "${fmodstudio_installed}") + else (DARWIN) + file(ARCHIVE_EXTRACT + INPUT $ENV{HOME}/Downloads/fmodstudioapi20223linux.tar.gz + DESTINATION ${CMAKE_BINARY_DIR} + ) + file( + COPY + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod.hpp + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_codec.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_common.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_dsp.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_dsp_effects.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_errors.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_output.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/fmodstudio + ) + file( + COPY + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so.13 + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so.13.23 + DESTINATION ${LIBS_PREBUILT_DIR}/lib/release + FOLLOW_SYMLINK_CHAIN + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/fmodstudio_installed "0") + endif (DARWIN) + else (USESYSTEMLIBS AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/fmodstudio_installed OR NOT ${fmodstudio_installed} EQUAL 0)) use_prebuilt_binary(fmodstudio) - endif () + endif (USESYSTEMLIBS AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/fmodstudio_installed OR NOT ${fmodstudio_installed} EQUAL 0)) if (WINDOWS) target_link_libraries( ll::fmodstudio INTERFACE fmod_vc) elseif (DARWIN) @@ -42,9 +101,7 @@ if (USE_FMODSTUDIO) target_link_libraries( ll::fmodstudio INTERFACE fmod) endif (WINDOWS) - if (NOT USESYSTEMLIBS) target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/fmodstudio) - endif () endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) else() set( USE_FMODSTUDIO "OFF") diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index bdd8bc4836..648a08454b 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -2,11 +2,9 @@ include(Prebuilt) add_library( ll::glh_linear INTERFACE IMPORTED ) +target_include_directories( ll::glh_linear SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) -if (USESYSTEMLIBS) - target_include_directories( ll::glh_linear SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) - return () -endif () - +if (NOT USESYSTEMLIBS) use_system_binary( glh_linear ) +endif (NOT USESYSTEMLIBS) use_prebuilt_binary(glh_linear) diff --git a/indra/cmake/GLM.cmake b/indra/cmake/GLM.cmake index 9cf410d9c3..451b7292cb 100644 --- a/indra/cmake/GLM.cmake +++ b/indra/cmake/GLM.cmake @@ -3,12 +3,12 @@ include(Prebuilt) add_library( ll::glm INTERFACE IMPORTED ) -if (USESYSTEMLIBS) - if (NOT LINUX) - find_package( glm REQUIRED ) - endif () - return () -else () +if (NOT USESYSTEMLIBS) use_system_binary( glm ) +elseif (NOT LINUX) + find_package( glm REQUIRED ) +endif (NOT USESYSTEMLIBS) + +if (LINUX OR USESYSTEMLIBS) use_prebuilt_binary(glm) -endif () +endif (LINUX OR USESYSTEMLIBS) diff --git a/indra/cmake/LLCoreHttp.cmake b/indra/cmake/LLCoreHttp.cmake index 22ed5fef9c..5464e4d327 100644 --- a/indra/cmake/LLCoreHttp.cmake +++ b/indra/cmake/LLCoreHttp.cmake @@ -1,5 +1,5 @@ # -*- cmake -*- -include(CURL) include(OpenSSL) +include(CURL) include(NGHTTP2) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 9f0419c5e6..779576a485 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -5,26 +5,56 @@ include(Prebuilt) include_guard() add_library( ll::libvlc INTERFACE IMPORTED ) -if (USE_AUTOBUILD_3P OR USE_CONAN) -use_prebuilt_binary(vlc-bin) -set(LIBVLCPLUGIN ON CACHE BOOL - "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") -else () +if (USESYSTEMLIBS) if (DARWIN) + if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/vlc_installed OR NOT ${vlc_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/vlc-3.0.21-arm64.dmg) + file(DOWNLOAD + https://get.videolan.org/vlc/3.0.21/macosx/vlc-3.0.21-arm64.dmg + ${CMAKE_BINARY_DIR}/vlc-3.0.21-arm64.dmg + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/vlc-3.0.21-arm64.dmg) + file(WRITE ${PREBUILD_TRACKING_DIR}/vlc_installed "0") + endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/vlc_installed OR NOT ${vlc_installed} EQUAL 0) + execute_process( + COMMAND hdiutil attach -noverify vlc-3.0.21-arm64.dmg + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + else (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/vlc_installed OR NOT ${vlc_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/vlc-3.0.21-intel64.dmg) + file(DOWNLOAD + https://get.videolan.org/vlc/3.0.21/macosx/vlc-3.0.21-intel64.dmg + ${CMAKE_BINARY_DIR}/vlc-3.0.21-intel64.dmg + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/vlc-3.0.21-intel64.dmg) + file(WRITE ${PREBUILD_TRACKING_DIR}/vlc_installed "0") + endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/vlc_installed OR NOT ${vlc_installed} EQUAL 0) + execute_process( + COMMAND hdiutil attach -noverify vlc-3.0.21-intel64.dmg + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) target_include_directories( ll::libvlc SYSTEM INTERFACE /Volumes/VLC\ media\ player/VLC.app/Contents/MacOS/include) target_link_directories( ll::libvlc INTERFACE /Volumes/VLC\ media\ player/VLC.app/Contents/MacOS/lib) target_link_libraries( ll::libvlc INTERFACE vlc vlccore ) - else () + else (DARWIN) include(FindPkgConfig) pkg_check_modules(Libvlc REQUIRED libvlc vlc-plugin) target_include_directories( ll::libvlc SYSTEM INTERFACE ${Libvlc_INCLUDE_DIRS} ) target_link_directories( ll::libvlc INTERFACE ${Libvlc_LIBRARY_DIRS} ) target_link_libraries( ll::libvlc INTERFACE ${Libvlc_LIBRARIES} ) - endif () + endif (DARWIN) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") return() -endif () +else (USESYSTEMLIBS) + +use_prebuilt_binary(vlc-bin) +set(LIBVLCPLUGIN ON CACHE BOOL + "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") +endif (USESYSTEMLIBS) if (WINDOWS) target_link_libraries( ll::libvlc INTERFACE diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake index a1cf81be80..0dc4069431 100644 --- a/indra/cmake/Meshoptimizer.cmake +++ b/indra/cmake/Meshoptimizer.cmake @@ -6,14 +6,66 @@ include(Prebuilt) include_guard() add_library( ll::meshoptimizer INTERFACE IMPORTED ) -if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) - target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${CMAKE_SYSROOT}/usr/local/include ) - target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer) - return () -endif () - +if (NOT USESYSTEMLIBS) use_system_binary(meshoptimizer) +else (NOT USESYSTEMLIBS) + if (NOT (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN)) + find_package(meshoptimizer) + target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer) + endif (NOT (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN)) +endif (NOT USESYSTEMLIBS) + +if (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR NOT USESYSTEMLIBS) + if (USESYSTEMLIBS) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/meshoptimizer_installed OR NOT ${meshoptimizer_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz) + file(DOWNLOAD + https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.21.tar.gz + ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz + DESTINATION ${CMAKE_BINARY_DIR} + ) + if (DARWIN) + try_compile(MESHOPTIMIZER_RESULT + PROJECT meshoptimizer + SOURCE_DIR ${CMAKE_BINARY_DIR}/meshoptimizer-0.21 + BINARY_DIR ${CMAKE_BINARY_DIR}/meshoptimizer-0.21 + TARGET meshoptimizer + CMAKE_FLAGS + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} + -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.15 + OUTPUT_VARIABLE meshoptimizer_installed + ) + else (DARWIN) + try_compile(MESHOPTIMIZER_RESULT + PROJECT meshoptimizer + SOURCE_DIR ${CMAKE_BINARY_DIR}/meshoptimizer-0.21 + BINARY_DIR ${CMAKE_BINARY_DIR}/meshoptimizer-0.21 + TARGET meshoptimizer + CMAKE_FLAGS + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + OUTPUT_VARIABLE meshoptimizer_installed + ) + endif (DARWIN) + if (${MESHOPTIMIZER_RESULT}) + file( + COPY ${CMAKE_BINARY_DIR}/meshoptimizer-0.21/src/meshoptimizer.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/meshoptimizer + ) + file( + COPY ${CMAKE_BINARY_DIR}/meshoptimizer-0.21/libmeshoptimizer.a + DESTINATION ${LIBS_PREBUILT_DIR}/lib/release + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/meshoptimizer_installed "0") + endif (${MESHOPTIMIZER_RESULT}) + endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/meshoptimizer_installed OR NOT ${meshoptimizer_installed} EQUAL 0) + else (USESYSTEMLIBS) use_prebuilt_binary(meshoptimizer) + endif (USESYSTEMLIBS) if (WINDOWS) target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.lib) @@ -24,3 +76,4 @@ elseif (DARWIN) endif (WINDOWS) target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/meshoptimizer) +endif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR NOT USESYSTEMLIBS) diff --git a/indra/cmake/Mikktspace.cmake b/indra/cmake/Mikktspace.cmake index 9fd2becba4..c73321e313 100644 --- a/indra/cmake/Mikktspace.cmake +++ b/indra/cmake/Mikktspace.cmake @@ -1,6 +1,4 @@ # -*- cmake -*- include(Prebuilt) -if (NOT USESYSTEMLIBS) use_prebuilt_binary(mikktspace) -endif (NOT USESYSTEMLIBS) diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index 326ef26c2c..1bf6c5086c 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -7,13 +7,47 @@ include_guard() add_library( ll::ndof INTERFACE IMPORTED ) if (NDOF) - if (NOT USESYSTEMLIBS) if (WINDOWS OR DARWIN) + if (USESYSTEMLIBS) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/libndofdev_installed OR NOT ${libndofdev_installed} EQUAL 0) + file(DOWNLOAD + https://github.com/secondlife/3p-libndofdev/archive/refs/tags/v0.1.8e9edc7.tar.gz + ${CMAKE_BINARY_DIR}/3p-libndofdev-0.1.8e9edc7.tar.gz + ) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/3p-libndofdev-0.1.8e9edc7.tar.gz + DESTINATION ${CMAKE_BINARY_DIR} + ) + try_compile(LIBNDOFDEV_RESULT + PROJECT libndofdev + SOURCE_DIR ${CMAKE_BINARY_DIR}/3p-libndofdev-0.1.8e9edc7/libndofdev + BINARY_DIR ${CMAKE_BINARY_DIR}/3p-libndofdev-0.1.8e9edc7/libndofdev + TARGET ndofdev + CMAKE_FLAGS + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} + -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.15 + -DCMAKE_C_FLAGS:STRING=-DTARGET_OS_MAC\ -Wno-int-conversion + OUTPUT_VARIABLE libndofdev_installed + ) + if (${LIBNDOFDEV_RESULT}) + file( + COPY ${CMAKE_BINARY_DIR}/3p-libndofdev-0.1.8e9edc7/libndofdev/src/ndofdev_external.h + DESTINATION ${LIBS_PREBUILT_DIR}/include + ) + file( + COPY ${CMAKE_BINARY_DIR}/3p-libndofdev-0.1.8e9edc7/libndofdev/src/libndofdev.dylib + DESTINATION ${LIBS_PREBUILT_DIR}/lib/release + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/libndofdev_installed "0") + endif (${LIBNDOFDEV_RESULT}) + endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/libndofdev_installed OR NOT ${libndofdev_installed} EQUAL 0) + else (USESYSTEMLIBS) use_prebuilt_binary(libndofdev) + endif (USESYSTEMLIBS) elseif (LINUX) use_prebuilt_binary(open-libndofdev) endif (WINDOWS OR DARWIN) - endif (NOT USESYSTEMLIBS) if (WINDOWS) target_link_libraries( ll::ndof INTERFACE libndofdev) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 6de03113ed..9bb222d8e8 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -6,15 +6,50 @@ add_library( ll::openjpeg INTERFACE IMPORTED ) if (NOT USESYSTEMLIBS) use_system_binary(openjpeg) -use_prebuilt_binary(openjpeg) -elseif (NOT LINUX) +elseif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD) include(FindPkgConfig) pkg_check_modules(Openjpeg REQUIRED libopenjp2) target_include_directories(ll::openjpeg SYSTEM INTERFACE ${Openjpeg_INCLUDE_DIRS}) target_link_directories(ll::openjpeg INTERFACE ${Openjpeg_LIBRARY_DIRS}) target_link_libraries(ll::openjpeg INTERFACE ${Openjpeg_LIBRARIES}) - return () endif (NOT USESYSTEMLIBS) +if (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/openjpeg_installed OR NOT ${openjpeg_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/openjpeg-2.5.2.tar.gz) + file(DOWNLOAD + https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.2.tar.gz + ${CMAKE_BINARY_DIR}/openjpeg-2.5.2.tar.gz + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/openjpeg-2.5.2.tar.gz) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/openjpeg-2.5.2.tar.gz + DESTINATION ${CMAKE_BINARY_DIR} + ) + execute_process( + COMMAND cmake + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + . + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/openjpeg-2.5.2 + RESULT_VARIABLE openjpeg_installed + ) + file( + COPY + ${CMAKE_BINARY_DIR}/openjpeg-2.5.2/src/lib/openjp2/cio.h + ${CMAKE_BINARY_DIR}/openjpeg-2.5.2/src/lib/openjp2/event.h + ${CMAKE_BINARY_DIR}/openjpeg-2.5.2/src/lib/openjp2/opj_config_private.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/openjpeg-2.5 + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/openjpeg_installed "${openjpeg_installed}") + endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/openjpeg_installed OR NOT ${openjpeg_installed} EQUAL 0) +else (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)) +use_prebuilt_binary(openjpeg) + if (NOT EXISTS ${LIBS_PREBUILT_DIR}/include/openjpeg-2.5) + file(RENAME + ${LIBS_PREBUILT_DIR}/include/openjpeg + ${LIBS_PREBUILT_DIR}/include/openjpeg-2.5 + ) + endif (NOT EXISTS ${LIBS_PREBUILT_DIR}/include/openjpeg-2.5) target_link_libraries(ll::openjpeg INTERFACE openjp2 ) +endif (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)) target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 26508dc429..4481b3460f 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -4,8 +4,158 @@ include(Prebuilt) include_guard() add_library( ll::openssl INTERFACE IMPORTED ) -#use_system_binary(openssl) -#use_prebuilt_binary(openssl) +if (NOT USESYSTEMLIBS) +use_system_binary(openssl) +endif (NOT USESYSTEMLIBS) +if (CMAKE_OSX_ARCHITECTURES MATCHES x86_64 OR LINUX OR NOT USESYSTEMLIBS) +use_prebuilt_binary(openssl) +elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/openssl_installed OR NOT ${openssl_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55.tar.gz) + file(DOWNLOAD + https://github.com/secondlife/3p-openssl/archive/refs/tags/v1.1.1q.de53f55.tar.gz + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55.tar.gz + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55.tar.gz) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55.tar.gz + DESTINATION ${CMAKE_BINARY_DIR} + ) + if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + set(ENV{CFLAGS} "-mmacosx-version-min=11.0") + execute_process( + COMMAND ./Configure no-shared darwin64-arm64-cc + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl + ) + else (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + execute_process( + COMMAND ./config no-shared + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl + ) + endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + execute_process( + COMMAND make -j${MAKE_JOBS} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl + RESULT_VARIABLE openssl_installed + ) + if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + unset(ENV{CFLAGS}) + endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + file( + COPY + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/aes.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/bnerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/conf_api.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/dtls1.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/evperr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/obj_mac.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/pkcs12.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/rsa.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/stack.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/x509.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/asn1.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/buffer.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/conferr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/e_os2.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/hmac.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/objects.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/pkcs12err.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/rsaerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/store.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/x509_vfy.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/asn1_mac.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/buffererr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/crypto.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ebcdic.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/idea.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/objectserr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/pkcs7.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/safestack.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/storeerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/x509err.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/asn1err.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/camellia.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/cryptoerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ec.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/kdf.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ocsp.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/pkcs7err.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/seed.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/symhacks.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/x509v3.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/asn1t.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/cast.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ct.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ecdh.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/kdferr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ocsperr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/rand.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/sha.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/tls1.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/x509v3err.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/async.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/cmac.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/cterr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ecdsa.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/lhash.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/opensslconf.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/rand_drbg.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/srp.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ts.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/asyncerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/cms.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/des.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ecerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/md2.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/opensslv.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/randerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/srtp.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/tserr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/bio.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/cmserr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/dh.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/engine.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/md4.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ossl_typ.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/rc2.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ssl.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/txt_db.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/bioerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/comp.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/dherr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/engineerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/md5.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/pem.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/rc4.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ssl2.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ui.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/blowfish.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/comperr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/dsa.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/err.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/mdc2.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/pem2.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/rc5.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ssl3.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/uierr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/bn.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/conf.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/dsaerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/evp.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/modes.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/pemerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/ripemd.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/sslerr.h + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/whrlpool.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/openssl + ) + file( + COPY + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/libcrypto.a + ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/libssl.a + DESTINATION ${LIBS_PREBUILT_DIR}/lib/release + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/openssl_installed "${openssl_installed}") +endif (CMAKE_OSX_ARCHITECTURES MATCHES x86_64 OR LINUX OR NOT USESYSTEMLIBS) if (WINDOWS) target_link_libraries(ll::openssl INTERFACE libssl libcrypto) elseif (LINUX) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index b0acae279b..c7b628d370 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -40,6 +40,38 @@ macro (use_prebuilt_binary _binary) --install-dir=${AUTOBUILD_INSTALL_DIR} ${_binary} ") endif(DEBUG_PREBUILT) + if(USESYSTEMLIBS) + execute_process(COMMAND xmllint + --xpath + "//map/map/map/map/map/map/string[contains(text(),'${_binary}')][contains(text(),'common')]/text()" autobuild.xml + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/.. + OUTPUT_VARIABLE package_url + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if ("${package_url}" STREQUAL "") + string(TOLOWER ${CMAKE_SYSTEM_NAME} system_name) + if (${system_name} MATCHES freebsd) + set(system_name "linux") + endif (${system_name} MATCHES freebsd) + execute_process(COMMAND xmllint + --xpath + "//map/map/map/map/map/map/string[contains(text(),'${_binary}')][contains(text(),'${system_name}64')]/text()" autobuild.xml + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/.. + OUTPUT_VARIABLE package_url + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + endif ("${package_url}" STREQUAL "") + string(REGEX REPLACE ^https://github.com/secondlife/3p-${_binary}/releases/download/[vm][0-9]+.*/ "" package_name ${package_url}) + file(DOWNLOAD + ${package_url} + ${CMAKE_BINARY_DIR}/${package_name} + ) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/${package_name} + DESTINATION ${AUTOBUILD_INSTALL_DIR} + ) + set(${_binary}_installed 0) + else(USESYSTEMLIBS) execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}" install --install-dir=${AUTOBUILD_INSTALL_DIR} @@ -47,6 +79,7 @@ macro (use_prebuilt_binary _binary) WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" RESULT_VARIABLE ${_binary}_installed ) + endif(USESYSTEMLIBS) file(WRITE ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${${_binary}_installed}") endif(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0) diff --git a/indra/cmake/TinyEXR.cmake b/indra/cmake/TinyEXR.cmake index 7500b774d8..e741c07f6e 100644 --- a/indra/cmake/TinyEXR.cmake +++ b/indra/cmake/TinyEXR.cmake @@ -1,9 +1,7 @@ # -*- cmake -*- include(Prebuilt) -if (NOT USESYSTEMLIBS) use_prebuilt_binary(tinyexr) -endif () set(TINYEXR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tinyexr) diff --git a/indra/cmake/TinyGLTF.cmake b/indra/cmake/TinyGLTF.cmake index 7e74089208..92b2de309f 100644 --- a/indra/cmake/TinyGLTF.cmake +++ b/indra/cmake/TinyGLTF.cmake @@ -1,9 +1,7 @@ # -*- cmake -*- include(Prebuilt) -if (NOT USESYSTEMLIBS) use_prebuilt_binary(tinygltf) -endif (NOT USESYSTEMLIBS) set(TINYGLTF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tinygltf) diff --git a/indra/cmake/UnixInstall.cmake b/indra/cmake/UnixInstall.cmake index 59620b60b4..021700b374 100644 --- a/indra/cmake/UnixInstall.cmake +++ b/indra/cmake/UnixInstall.cmake @@ -6,64 +6,36 @@ set(INSTALL OFF CACHE BOOL "Generate install target.") if (INSTALL) - - if (DARWIN) - - set(INSTALL_PREFIX - ${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents - CACHE PATH - "Top-level installation directory.") - - set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/Resources - CACHE PATH - "Installation directory for read-only shared files.") - - set(INSTALL_SHARE_DIR ${INSTALL_LIBRARY_DIR} CACHE PATH - "Installation directory for read-only shared files.") - - set(APP_BINARY_DIR ${INSTALL_PREFIX}/MacOS - CACHE PATH - "Installation directory for binaries.") - - set(APP_SHARE_DIR ${INSTALL_SHARE_DIR} - CACHE PATH - "Installation directory for read-only data files.") - - set(APP_LIBEXEC_DIR ${INSTALL_LIBRARY_DIR} - CACHE PATH - "Installation directory for non-manual executables.") - - else (DARWIN) - - set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH - "Top-level installation directory.") - - if (EXISTS ${CMAKE_SYSROOT}/usr/lib/${ARCH}-linux-gnu) - set(_LIB lib/${ARCH}-linux-gnu) - elseif (EXISTS /lib64) - set(_LIB lib64) - else () - set(_LIB lib) - endif () - - set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/${_LIB} CACHE PATH - "Installation directory for read-only shared files.") - - set(INSTALL_SHARE_DIR ${INSTALL_PREFIX}/share CACHE PATH - "Installation directory for read-only shared files.") - - set(APP_BINARY_DIR ${INSTALL_PREFIX}/bin - CACHE PATH - "Installation directory for binaries.") - - set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/${VIEWER_BINARY_NAME} - CACHE PATH - "Installation directory for read-only data files.") - - set(APP_LIBEXEC_DIR ${INSTALL_PREFIX}/libexec/${VIEWER_BINARY_NAME} - CACHE PATH - "Installation directory for non-manual executables.") - - endif (DARWIN) - + if (CMAKE_SYSTEM_NAME MATCHES FreeBSD) + set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH + "Top-level installation directory.") + else (CMAKE_SYSTEM_NAME MATCHES FreeBSD) + set(INSTALL_PREFIX /usr CACHE PATH + "Top-level installation directory.") + endif (CMAKE_SYSTEM_NAME MATCHES FreeBSD) + + if (EXISTS /lib64) + set(_LIB lib64) + elseif (EXISTS ${CMAKE_SYSROOT}/usr/lib/${ARCH}-linux-gnu) + set(_LIB lib/${ARCH}-linux-gnu) + else (EXISTS /lib64) + set(_LIB lib) + endif (EXISTS /lib64) + + set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/${_LIB} CACHE PATH + "Installation directory for read-only shared files.") + + set(INSTALL_SHARE_DIR ${INSTALL_PREFIX}/share CACHE PATH + "Installation directory for read-only shared files.") + + set(APP_BINARY_DIR ${INSTALL_LIBRARY_DIR}/secondlife-${viewer_VERSION} + CACHE PATH + "Installation directory for binaries.") + + set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/${VIEWER_BINARY_NAME} + CACHE PATH + "Installation directory for read-only data files.") + set(APP_LIBEXEC_DIR ${INSTALL_PREFIX}/libexec/${VIEWER_BINARY_NAME} + CACHE PATH + "Installation directory for non-manual executables.") endif (INSTALL) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index f746cdab78..c287f135fe 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -101,12 +101,15 @@ else (ADDRESS_SIZE EQUAL 32) endif() endif (ADDRESS_SIZE EQUAL 32) +cmake_host_system_information(RESULT MAKE_JOBS QUERY NUMBER_OF_LOGICAL_CORES) + if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(WINDOWS ON BOOL FORCE) endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(LINUX ON BOOl FORCE) + cmake_host_system_information(RESULT LINUX_DISTRO QUERY DISTRIB_ID) if (ADDRESS_SIZE EQUAL 32) set(DEB_ARCHITECTURE i386) diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 7de21fd59b..4df54e2b59 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -1,24 +1,48 @@ # -*- cmake -*- include(Prebuilt) -if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) - add_library( ll::fontconfig INTERFACE IMPORTED ) - use_system_binary(fontconfig) -endif () - -if (LINUX) +if (NOT DARWIN) add_library( ll::fontconfig INTERFACE IMPORTED ) find_package(Fontconfig REQUIRED) target_link_libraries( ll::fontconfig INTERFACE Fontconfig::Fontconfig ) -endif (LINUX) +endif (NOT DARWIN) -if( NOT USE_CONAN ) +if( USE_AUTOBUILD_3P ) use_prebuilt_binary(libhunspell) endif() +if (NOT USESYSTEMLIBS) use_prebuilt_binary(slvoice) use_prebuilt_binary(nanosvg) +elseif (${LINUX_DISTRO} MATCHES debian OR DARWIN) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/nanosvg_installed OR NOT ${nanosvg_installed} EQUAL 0) + if (DARWIN) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/nanosvg-2022.09.27-darwin64-580364.tar.bz2) + file(DOWNLOAD + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/115452/994130/nanosvg-2022.09.27-darwin64-580364.tar.bz2 + ${CMAKE_BINARY_DIR}/nanosvg-2022.09.27-darwin64-580364.tar.bz2 + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/nanosvg-2022.09.27-darwin64-580364.tar.bz2) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/nanosvg-2022.09.27-darwin64-580364.tar.bz2 + DESTINATION ${LIBS_PREBUILT_DIR} + ) + else (DARWIN) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/nanosvg-2022.09.27-linux-580337.tar.bz2) + file(DOWNLOAD + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/115397/993664/nanosvg-2022.09.27-linux-580337.tar.bz2 + ${CMAKE_BINARY_DIR}/nanosvg-2022.09.27-linux-580337.tar.bz2 + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/nanosvg-2022.09.27-linux-580337.tar.bz2) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/nanosvg-2022.09.27-linux-580337.tar.bz2 + DESTINATION ${LIBS_PREBUILT_DIR} + ) + endif (DARWIN) + file(WRITE ${PREBUILD_TRACKING_DIR}/nanosvg_installed "0") + endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/nanosvg_installed OR NOT ${nanosvg_installed} EQUAL 0) +endif (NOT USESYSTEMLIBS) use_prebuilt_binary(viewer-fonts) use_prebuilt_binary(emoji_shortcodes) diff --git a/indra/cmake/WebRTC.cmake b/indra/cmake/WebRTC.cmake index 3120968560..fa8fa64ac0 100644 --- a/indra/cmake/WebRTC.cmake +++ b/indra/cmake/WebRTC.cmake @@ -6,9 +6,34 @@ include_guard() add_library( ll::webrtc INTERFACE IMPORTED ) target_include_directories( ll::webrtc SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/webrtc" "${LIBS_PREBUILT_DIR}/include/webrtc/third_party/abseil-cpp") -if (NOT USESYSTEMLIBS) +if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/webrtc_installed OR NOT ${webrtc_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/libwebrtc-macos-arm64.tar.xz) + file(DOWNLOAD + https://github.com/crow-misia/libwebrtc-bin/releases/download/114.5735.6.1/libwebrtc-macos-arm64.tar.xz + ${CMAKE_BINARY_DIR}/libwebrtc-macos-arm64.tar.xz + SHOW_PROGRESS + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/libwebrtc-macos-arm64.tar.xz) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/libwebrtc-macos-arm64.tar.xz + DESTINATION ${LIBS_PREBUILT_DIR} + ) + file(RENAME + ${LIBS_PREBUILT_DIR}/lib/libwebrtc.a + ${LIBS_PREBUILT_DIR}/lib/release/libwebrtc.a + ) + file(REMOVE_RECURSE ${LIBS_PREBUILT_DIR}/Frameworks/WebRTC.xcframework/macos-arm64/WebRTC.framework) + file(RENAME + ${LIBS_PREBUILT_DIR}/Frameworks/WebRTC.xcframework/macos-arm64/WebRTC.framework + ${LIBS_PREBUILT_DIR}/lib/release/WebRTC.framework + ) + file(REMOVE_RECURSE ${LIBS_PREBUILT_DIR}/Frameworks) + file(WRITE ${PREBUILD_TRACKING_DIR}/webrtc_installed "0") + endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/webrtc_installed OR NOT ${webrtc_installed} EQUAL 0) +elseif (NOT CMAKE_SYSTEM_NAME MATCHES FreeBSD) use_prebuilt_binary(webrtc) -endif () +endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) if (WINDOWS) target_link_libraries( ll::webrtc INTERFACE webrtc.lib ) diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 994df3d128..739648500c 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -4,20 +4,92 @@ include(Prebuilt) include_guard() add_library( ll::xmlrpc-epi INTERFACE IMPORTED ) -if (USE_AUTOBUILD_3P OR USE_CONAN) +if (NOT USESYSTEMLIBS) use_system_binary( xmlrpc-epi ) use_prebuilt_binary(xmlrpc-epi) -endif () - +elseif ((${LINUX_DISTRO} MATCHES opensuse-tumbleweed OR DARWIN) AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/xmlrpc-epi_installed OR NOT ${xmlrpc-epi_installed} EQUAL 0)) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2.tar.bz2) + file(DOWNLOAD + https://sourceforge.net/projects/xmlrpc-epi/files/xmlrpc-epi-base/0.54.2/xmlrpc-epi-0.54.2.tar.bz2 + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2.tar.bz2 + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2.tar.bz2) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2.tar.bz2 + DESTINATION ${CMAKE_BINARY_DIR} + ) + file( + COPY + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/base64.h + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/encodings.h + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/queue.h + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/simplestring.h + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/xml_element.h + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/xml_to_xmlrpc.h + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/xmlrpc.h + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/xmlrpc_introspection.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/xmlrpc-epi + ) + file(REMOVE + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/config.sub + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/missing + ) + execute_process( + COMMAND autoreconf -is + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2 + ) + set(ENV{CPPFLAGS} -I${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src) + if (DARWIN) + set(ENV{CFLAGS} "-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.15") + if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + execute_process( + COMMAND sed -i '' -e "s/XMLRPC_VALUE find_named_value/__attribute__((always_inline)) XMLRPC_VALUE find_named_value/g" + xmlrpc_introspection.c + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src + ) + execute_process( + COMMAND sed -i '' -e "s/void describe_method/__attribute__((always_inline)) void describe_method/g" + xmlrpc_introspection.c + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src + ) + execute_process( + COMMAND ./configure --disable-static --host=aarch64-apple-darwin + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2 + ) + else (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + execute_process( + COMMAND ./configure --disable-static --host=${CMAKE_OSX_ARCHITECTURES}-apple-darwin + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2 + ) + endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + unset(ENV{CFLAGS}) + else (DARWIN) + execute_process( + COMMAND ./configure --disable-shared + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2 + ) + endif (DARWIN) + execute_process( + COMMAND make -j${MAKE_JOBS} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2 + RESULT_VARIABLE xmlrpc-epi_installed + ) + unset(ENV{CPPFLAGS}) + file( + COPY + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/.libs/libxmlrpc-epi.dylib + ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/.libs/libxmlrpc-epi.0.dylib + DESTINATION ${LIBS_PREBUILT_DIR}/lib/release + FOLLOW_SYMLINK_CHAIN + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/xmlrpc-epi_installed "${xmlrpc-epi_installed}") +endif (NOT USESYSTEMLIBS) target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) - -if (USE_AUTOBUILD_3P OR USE_CONAN) +if (NOT USESYSTEMLIBS) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) +elseif (${LINUX_DISTRO} MATCHES opensuse-tumbleweed OR DARWIN) + target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/xmlrpc-epi) elseif (LINUX) - target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE - ${CMAKE_SYSROOT}/usr/include/xmlrpc-epi) -elseif (DARWIN) - target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) - target_link_directories( ll::xmlrpc-epi INTERFACE /usr/local/lib) + target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${CMAKE_SYSROOT}/usr/include/xmlrpc-epi) endif () diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index ad17754790..e611847a24 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -292,6 +292,20 @@ target_link_libraries( target_include_directories(llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/sse2neon_installed OR NOT ${sse2neon_installed} EQUAL 0) + file(MAKE_DIRECTORY ${LIBS_PREBUILT_DIR}/include/sse2neon) + if (NOT EXISTS ${LIBS_PREBUILT_DIR}/include/sse2neon/sse2neon.h) + file(DOWNLOAD + 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) + 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) + target_include_directories(llcommon PUBLIC ${LIBS_PREBUILT_DIR}/include/sse2neon) +endif () + if (USE_AUTOBUILD_3P OR USE_CONAN) add_dependencies(llcommon stage_third_party_libs) else () diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index 7db1971460..8d85f739b3 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -4,6 +4,9 @@ project(llfilesystem) include(00-Common) include(LLCommon) +if (LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD) + include(UnixInstall) +endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD) set(llfilesystem_SOURCE_FILES lldir.cpp @@ -30,17 +33,17 @@ if (DARWIN) LIST(APPEND llfilesystem_HEADER_FILES lldir_mac.h) endif (DARWIN) -if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +if (LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD) LIST(APPEND llfilesystem_SOURCE_FILES lldir_linux.cpp) LIST(APPEND llfilesystem_HEADER_FILES lldir_linux.h) if (INSTALL) set_source_files_properties(lldir_linux.cpp PROPERTIES COMPILE_FLAGS - "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\" -DAPP_LIBEXEC_DIR=\\\"${APP_LIBEXEC_DIR}\\\" -DAPP_PLUGIN_DIR=\\\"${INSTALL_LIBRARY_DIR}\\\"" + "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\" -DAPP_LIBEXEC_DIR=\\\"${APP_LIBEXEC_DIR}\\\" -DAPP_PLUGIN_DIR=\\\"${INSTALL_LIBRARY_DIR}\\\"" ) endif (INSTALL) -endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD) if (WINDOWS) LIST(APPEND llfilesystem_SOURCE_FILES lldir_win32.cpp) @@ -55,7 +58,6 @@ target_link_libraries(llfilesystem llcommon ) target_include_directories( llfilesystem INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - include(LibraryInstall) # Add tests diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 969bf68b6d..a64ae8e55c 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -28,15 +28,9 @@ #include "llimagej2coj.h" // this is defined so that we get static linking. -#if LL_LINUX || !LL_USESYSTEMLIBS -#include "openjpeg/openjpeg.h" -#include "openjpeg/event.h" -#include "openjpeg/cio.h" -#else #include <openjpeg-2.5/openjpeg.h> #include <openjpeg-2.5/event.h> #include <openjpeg-2.5/cio.h> -#endif #define MAX_ENCODED_DISCARD_LEVELS 5 diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 0b3258c105..7d56f12766 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -839,7 +839,7 @@ extern PFNGLPOLYGONOFFSETCLAMPPROC glPolygonOffsetClamp; #define GL_EXT_separate_specular_color 1 #define GL_GLEXT_PROTOTYPES -#include "GL/glext.h" +#include <OpenGL/glext.h> #define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED #include <OpenGL/gl3.h> diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 1037fbbfe3..633a453ab0 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1714,7 +1714,7 @@ void LLRender::flush() } //LL_INFOS() << "LLVertexBuffer::sMappingMode " << LLVertexBuffer::sMappingMode << LL_ENDL; - if(LLVertexBuffer::sMappingMode > 1) + if(LLVertexBuffer::sMappingMode == 3) { vb->unmapBuffer(); } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index b522eb5218..6cded7f67a 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -373,7 +373,7 @@ public: ~LLVBOPool() { - if(mMappingMode > 1) return; + if(mMappingMode == 3) return; clear(); } @@ -392,7 +392,7 @@ public: U64 getVramBytesUsed() { - if(mMappingMode > 1) return mAllocated; + if(mMappingMode == 3) return mAllocated; else return mAllocated + mReserved; } @@ -415,7 +415,7 @@ public: llassert(data == nullptr); // non null data indicates a buffer that wasn't freed llassert(size >= 2); // any buffer size smaller than a single index is nonsensical - if(mMappingMode > 1) + if(mMappingMode == 3) { mAllocated += size; @@ -483,7 +483,7 @@ public: llassert(type == GL_ARRAY_BUFFER || type == GL_ELEMENT_ARRAY_BUFFER); llassert(size >= 2); - if(mMappingMode > 1) + if(mMappingMode == 3) { if (data) { @@ -887,7 +887,7 @@ void LLVertexBuffer::initClass(LLWindow* window) sVBOPool = new LLVBOPool(); sVBOPool->mMappingMode = sMappingMode; - //LL_INFOS() << "milo sVBOPool intialized with " << sMappingMode << LL_ENDL; + //LL_INFOS() << "sVBOPool intialized with mapping mode: " << sMappingMode << LL_ENDL; #if ENABLE_GL_WORK_QUEUE sQueue = new GLWorkQueue(); @@ -1196,7 +1196,7 @@ U8* LLVertexBuffer::mapVertexBuffer(LLVertexBuffer::AttributeType type, U32 inde count = mNumVerts - index; } - if(sMappingMode < 2) + if(sMappingMode != 3) { U32 start = mOffsets[type] + sTypeSize[type] * index; U32 end = start + sTypeSize[type] * count-1; @@ -1233,7 +1233,7 @@ U8* LLVertexBuffer::mapIndexBuffer(U32 index, S32 count) count = mNumIndices-index; } - if(sMappingMode < 2) + if(sMappingMode != 3) { U32 start = sizeof(U16) * index; U32 end = start + sizeof(U16) * count-1; @@ -1268,9 +1268,24 @@ U8* LLVertexBuffer::mapIndexBuffer(U32 index, S32 count) // dst -- mMappedData or mMappedIndexData void LLVertexBuffer::flush_vbo(GLenum target, U32 start, U32 end, void* data, U8* dst) { - if(sMappingMode > 1) + if(sMappingMode == 2) + { + //LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("vb glMapBufferRange"); + if (end == 0) return; + U32 buffer_size = end-start+1; + U8 * mptr = (U8*) glMapBufferRange( target, start, end-start+1, GL_MAP_WRITE_BIT); + + if (mptr) + { + std::memcpy(mptr, (U8*) data, buffer_size); + if(!glUnmapBuffer(target)) LL_WARNS() << "glUnmapBuffer() failed" << LL_ENDL; + } + else LL_WARNS() << "glMapBufferRange() returned NULL" << LL_ENDL; + return; + } + + if(sMappingMode == 3) { - //LL_INFOS() << "milo flush_vbo() NO POOL" << LL_ENDL; LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("vb memcpy"); //STOP_GLERROR; // copy into mapped buffer @@ -1312,7 +1327,7 @@ void LLVertexBuffer::unmapBuffer() } }; - if(sMappingMode > 1) + if(sMappingMode == 3) { //STOP_GLERROR; if (mMappedData) @@ -1324,8 +1339,7 @@ void LLVertexBuffer::unmapBuffer() mGLBuffer = gen_buffer(); glBindBuffer(GL_ARRAY_BUFFER, mGLBuffer); sGLRenderBuffer = mGLBuffer; - if(sMappingMode==2) glBufferData(GL_ARRAY_BUFFER, mSize, mMappedData, GL_STATIC_DRAW); - else glBufferData(GL_ARRAY_BUFFER, mSize, mMappedData, GL_DYNAMIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, mSize, mMappedData, GL_DYNAMIC_DRAW); } else if (mGLBuffer != sGLRenderBuffer) { @@ -1345,8 +1359,7 @@ void LLVertexBuffer::unmapBuffer() glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mGLIndices); sGLRenderIndices = mGLIndices; - if(sMappingMode==2) glBufferData(GL_ELEMENT_ARRAY_BUFFER, mIndicesSize, mMappedIndexData, GL_STATIC_DRAW); - else glBufferData(GL_ELEMENT_ARRAY_BUFFER, mIndicesSize, mMappedIndexData, GL_DYNAMIC_DRAW); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, mIndicesSize, mMappedIndexData, GL_DYNAMIC_DRAW); } else if (mGLIndices != sGLRenderIndices) { @@ -1543,10 +1556,10 @@ bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4>& strider, U32 in // Set for rendering void LLVertexBuffer::setBuffer() { - if(sMappingMode > 1) + if(sMappingMode == 3) { if (!mGLBuffer) - { // OS X doesn't allocate a buffer until we call unmapBuffer + { return; } } diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 39353401e9..7f44270fe7 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -107,7 +107,6 @@ if (DARWIN) -change "/opt/local/lib/libpng16.16.dylib" "@loader_path/../../Frameworks/libpng16.16.dylib" -change "/opt/local/lib/libjpeg.8.dylib" "@loader_path/../../Frameworks/libjpeg.8.dylib" -change "/opt/local/lib/libfreetype.6.dylib" "@loader_path/../../Frameworks/libfreetype.6.dylib" - -change "@rpath/libmeshoptimizer.dylib" "@loader_path/../../Frameworks/libmeshoptimizer.dylib" -change "/opt/local/lib/libaprutil-1.0.dylib" "@loader_path/../../Frameworks/libaprutil-1.0.dylib" -change "/opt/local/lib/libiconv.2.dylib" "@loader_path/../../Frameworks/libiconv.2.dylib" -change "/opt/local/lib/libapr-1.0.dylib" "@loader_path/../../Frameworks/libapr-1.0.dylib" diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index 3c499b0cbd..1710d18f4d 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -53,7 +53,6 @@ if (DARWIN) -change "/opt/local/lib/libpng16.16.dylib" "@loader_path/../../Frameworks/libpng16.16.dylib" -change "/opt/local/lib/libjpeg.8.dylib" "@loader_path/../../Frameworks/libjpeg.8.dylib" -change "/opt/local/lib/libfreetype.6.dylib" "@loader_path/../../Frameworks/libfreetype.6.dylib" - -change "@rpath/libmeshoptimizer.dylib" "@loader_path/../../Frameworks/libmeshoptimizer.dylib" -change "/opt/local/lib/libaprutil-1.0.dylib" "@loader_path/../../Frameworks/libaprutil-1.0.dylib" -change "/opt/local/lib/libiconv.2.dylib" "@loader_path/../../Frameworks/libiconv.2.dylib" -change "/opt/local/lib/libapr-1.0.dylib" "@loader_path/../../Frameworks/libapr-1.0.dylib" diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c3e46cc615..546e38b4d7 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -9,26 +9,24 @@ include(Linking) include(Boost) include(bugsplat) -if (USE_AUTOBUILD_3P OR USE_CONAN) +if (NOT USESYSTEMLIBS) include(BuildPackagesInfo) endif () include(BuildVersion) include(CMakeCopyIfDifferent) -if (USE_AUTOBUILD_3P OR USE_CONAN) +if (NOT USESYSTEMLIBS) include(CubemapToEquirectangularJS) include(DBusGlib) endif () include(DragDrop) include(EXPAT) include(Hunspell) -if (USE_AUTOBUILD_3P OR USE_CONAN) +if (NOT USESYSTEMLIBS) include(JPEGEncoderBasic) endif () include(LLAppearance) include(LLAudio) -if (USE_AUTOBUILD_3P OR USE_CONAN) include(LLCA) -endif () include(LLCommon) include(LLCoreHttp) include(LLImage) @@ -50,7 +48,7 @@ endif () include(Tracy) include(UI) include(ViewerMiscLibs) -if (USE_AUTOBUILD_3P OR USE_CONAN) +if (NOT USESYSTEMLIBS) include(ViewerManager) endif () include(VisualLeakDetector) @@ -58,15 +56,15 @@ include(VulkanGltf) include(ZLIBNG) include(URIPARSER) include(LLPrimitive) + if (ENABLE_MEDIA_PLUGINS) - include(LibVLCPlugin) - if (DARWIN OR LINUX) - include(CEFPlugin) - endif (DARWIN OR LINUX) + include(LibVLCPlugin) + if (DARWIN OR LINUX) + include(CEFPlugin) + endif (DARWIN OR LINUX) endif (ENABLE_MEDIA_PLUGINS) -include(UnixInstall) -if ((USE_AUTOBUILD_3P OR USE_CONAN) AND NOT HAVOK_TPV) +if (NOT (USESYSTEMLIBS OR HAVOK_TPV)) # When using HAVOK_TPV, the library is precompiled, so no need for this # Stub and probably havok lib itself is a hack, autobuild loads a 3p that really is a source tarball @@ -87,7 +85,7 @@ if ((USE_AUTOBUILD_3P OR USE_CONAN) AND NOT HAVOK_TPV) target_compile_options( llphysicsextensions PRIVATE -Wno-unused-local-typedef) endif (DARWIN) endif() -endif ((USE_AUTOBUILD_3P OR USE_CONAN) AND NOT HAVOK_TPV) +endif (NOT (USESYSTEMLIBS OR HAVOK_TPV)) set(viewer_SOURCE_FILES gltfscenemanager.cpp @@ -1416,21 +1414,18 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}\n") set_source_files_properties( - llversioninfo.cpp tests/llversioninfo_test.cpp + llversioninfo.cpp tests/llversioninfo_test.cpp PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # see BuildVersion.cmake ) if (DARWIN) -# if (NOT USESYSTEMLIBS) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.mm) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.h) -# endif (NOT USESYSTEMLIBS) LIST(APPEND viewer_SOURCE_FILES llfilepicker_mac.mm) LIST(APPEND viewer_HEADER_FILES llfilepicker_mac.h) -# if (NOT USESYSTEMLIBS) # This should be compiled with the viewer. LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm) set_source_files_properties( @@ -1445,7 +1440,6 @@ if (DARWIN) # warnings. COMPILE_FLAGS "-fmodules -fcxx-modules -Wno-nullability-completeness" ) -# endif (NOT USESYSTEMLIBS) # Add resource files to the project. set(viewer_RESOURCE_FILES @@ -1471,9 +1465,9 @@ if (USESYSTEMLIBS AND NOT DARWIN) PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" ) - if (NOT (CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")) + if (NOT CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") - endif () + endif () endif (USESYSTEMLIBS AND NOT DARWIN) @@ -1622,7 +1616,7 @@ endif (WINDOWS) file(GLOB_RECURSE viewer_XUI_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/skins/*.xml) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/skins PREFIX "XUI Files" FILES ${viewer_XUI_FILES}) -set_source_files_properties(${viewer_XUI_FILES} +set_source_files_properties(${viewer_XUI_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) @@ -1630,7 +1624,7 @@ list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders/*.glsl) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders PREFIX "Shaders" FILES ${viewer_SHADER_FILES}) -set_source_files_properties(${viewer_SHADER_FILES} +set_source_files_properties(${viewer_SHADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES}) @@ -1662,8 +1656,8 @@ set(viewer_APPSETTINGS_FILES featuretable_mac.txt ) -if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) - list(REMOVE_ITEM viewer_APPSETTINGS_FILES packages-info.txt) +if (USESYSTEMLIBS) + list(REMOVE_ITEM viewer_APPSETTINGS_FILES packages-info.txt) endif () source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES}) @@ -1915,7 +1909,7 @@ endif (WINDOWS) # one of these being libz where you can find four or more versions in play # at once. On Linux, libz can be found at link and run time via a number # of paths: -# +# # => -lfreetype # => libz.so.1 (on install machine, not build) # => -lSDL @@ -1979,43 +1973,43 @@ set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Path to artwork files.") set_source_files_properties(llinventorygallery.cpp PROPERTIES COMPILE_FLAGS - -Wno-unused-but-set-variable) + -Wno-unused-but-set-variable) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set_source_files_properties(llappviewerlinux.cpp PROPERTIES - COMPILE_FLAGS -Wno-dangling-gsl - ) - set_source_files_properties(llviewerstats.cpp PROPERTIES - COMPILE_FLAGS -Wno-unused-value) + set_source_files_properties(llappviewerlinux.cpp PROPERTIES + COMPILE_FLAGS -Wno-dangling-gsl + ) + set_source_files_properties(llviewerstats.cpp PROPERTIES + COMPILE_FLAGS -Wno-unused-value) elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set_source_files_properties( - llface.cpp - llhttpretrypolicy.cpp - llmodelpreview.cpp - llpanelface.cpp - lltexturefetch.cpp - PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized) - set_source_files_properties(llfasttimerview.cpp PROPERTIES - COMPILE_FLAGS -Wno-nonnull) - set_source_files_properties(llinventorygallerymenu.cpp PROPERTIES - COMPILE_FLAGS -Wno-uninitialized) - set_source_files_properties(llviewerstats.cpp PROPERTIES - COMPILE_FLAGS -Wno-unused-value) - set_source_files_properties(llurl.cpp PROPERTIES COMPILE_FLAGS - -Wno-stringop-truncation) - set_source_files_properties( - llfloaterimsessiontab.cpp - llfloatersimplesnapshot.cpp - llfloatersidepanelcontainer.cpp - llinventorypanel.cpp - llpanelmaininventory.cpp - llpathfindingnavmesh.cpp - llsidepanelinventory.cpp - PROPERTIES COMPILE_FLAGS -Wno-dangling-reference - ) - set_source_files_properties( - gltf/animation.cpp - gltf/primitive.cpp - PROPERTIES COMPILE_FLAGS -Wno-unused-function) + set_source_files_properties( + llface.cpp + llhttpretrypolicy.cpp + llmodelpreview.cpp + llpanelface.cpp + lltexturefetch.cpp + PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized) + set_source_files_properties(llfasttimerview.cpp PROPERTIES + COMPILE_FLAGS -Wno-nonnull) + set_source_files_properties(llinventorygallerymenu.cpp PROPERTIES + COMPILE_FLAGS -Wno-uninitialized) + set_source_files_properties(llviewerstats.cpp PROPERTIES + COMPILE_FLAGS -Wno-unused-value) + set_source_files_properties(llurl.cpp PROPERTIES COMPILE_FLAGS + -Wno-stringop-truncation) + set_source_files_properties( + llfloaterimsessiontab.cpp + llfloatersimplesnapshot.cpp + llfloatersidepanelcontainer.cpp + llinventorypanel.cpp + llpanelmaininventory.cpp + llpathfindingnavmesh.cpp + llsidepanelinventory.cpp + PROPERTIES COMPILE_FLAGS -Wno-dangling-reference + ) + set_source_files_properties( + gltf/animation.cpp + gltf/primitive.cpp + PROPERTIES COMPILE_FLAGS -Wno-unused-function) endif () message("Copying fonts") @@ -2036,13 +2030,96 @@ foreach(elem ${country_codes}) set(emoji_mapping_src_file "${emoji_mapping_src_folder}/${elem}/emoji_characters.xml") set(emoji_mapping_dst_file - "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml") + "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml") configure_file(${emoji_mapping_src_file} ${emoji_mapping_dst_file} COPYONLY) endforeach() -if (NOT USESYSTEMLIBS) +if (PACKAGE AND USESYSTEMLIBS) + set(CPACK_PACKAGE_NAME ${VIEWER_BINARY_NAME} + CACHE STRING "Viewer binary name.") + set(CPACK_PACKAGE_VERSION ${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION} + CACHE STRING "Viewer major.minor.patch.revision versions.") + set(VIEWER_PACKAGE_COMMENT + "A fork of the Second Life viewer" + ) + set(VIEWER_PACKAGE_DESCRIPTION + "An entrance to virtual empires in only megabytes. A shelter for the metaverse refugees, especially those from less supported operating systems." + ) + set(VIEWER_PACKAGE_DOMAIN_NAME + ${VIEWER_BINARY_NAME}.net + ) +endif (PACKAGE AND USESYSTEMLIBS) if (LINUX) + if (USESYSTEMLIBS) + add_custom_command( + TARGET ${VIEWER_BINARY_NAME} POST_BUILD + COMMAND ${CMAKE_SYSROOT}/usr/bin/sed + ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND ${CMAKE_SYSROOT}/usr/bin/sed + ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND ${CMAKE_SYSROOT}/usr/bin/sed + ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND ${CMAKE_SYSROOT}/usr/bin/sed + ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND ${CMAKE_SYSROOT}/usr/bin/sed + ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND ${CMAKE_SYSROOT}/usr/bin/sed + ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^ .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND sort + ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND paste + ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt + COMMAND ${CMAKE_SYSROOT}/usr/bin/sed + ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt + ) + if (PACKAGE) + if (${LINUX_DISTRO} MATCHES debian OR ${LINUX_DISTRO} MATCHES ubuntu) + set(CPACK_BINARY_DEB ON CACHE BOOL "Able to package Debian DEB.") + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE + amd64 + CACHE STRING "Debian package architecture.") + set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${VIEWER_PACKAGE_COMMENT} + CACHE STRING "Debian package description.") + set(CPACK_DEBIAN_PACKAGE_MAINTAINER + $ENV{USER}@${VIEWER_PACKAGE_DOMAIN_NAME} + CACHE STRING "Debian package maintainer.") + set(CPACK_DEBIAN_PACKAGE_SECTION net + CACHE STRING "Debian package section.") + if (${LINUX_DISTRO} MATCHES debian) + set(CPACK_DEBIAN_PACKAGE_DEPENDS + "libalut0, libaprutil1, libboost-fiber1.81.0, libboost-filesystem1.81.0, libboost-program-options1.81.0, libboost-regex1.81.0, libboost-thread1.81.0, libcollada-dom2.5-dp0, libexpat1, libfltk1.3, libglu1-mesa, libhunspell-1.7-0, libmeshoptimizer2d (>= 0.18), libnghttp2-14, libsdl2-2.0-0, liburiparser1, libvlc5, libvorbisenc2, libvorbisfile3, libxmlrpc-epi0, vlc-plugin-base" + CACHE STRING "Debian package dependencies.") + elseif (${LINUX_DISTRO} MATCHES ubuntu) + set(CPACK_DEBIAN_PACKAGE_DEPENDS + "libalut0, libaprutil1t64, libboost-fiber1.83.0, libboost-filesystem1.83.0, libboost-program-options1.83.0, libboost-regex1.83.0, libboost-thread1.83.0, libcollada-dom2.5-dp0, libexpat1, libfltk2.0-0t64, libglu1-mesa, libhunspell-1.7-0, libmeshoptimizer2d, libnghttp2-14, libsdl2-2.0-0, liburiparser1, libvlc5, libvorbisenc2, libvorbisfile3, libxmlrpc-epi0t64, vlc-plugin-base" + CACHE STRING "Debian package dependencies.") + endif (${LINUX_DISTRO} MATCHES debian) + elseif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed)) + set(CPACK_BINARY_RPM ON CACHE BOOL "Able to package Fedora RPM.") + set(CPACK_RPM_PACKAGE_SUMMARY ${VIEWER_PACKAGE_COMMENT} + CACHE STRING "RPM package summary.") + set(CPACK_RPM_PACKAGE_ARCHITECTURE + ${CMAKE_SYSTEM_PROCESSOR} + CACHE STRING "RPM package architecture.") + set(CPACK_RPM_PACKAGE_LICENSE LGPL-2.1-only + CACHE STRING "RPM package license.") + set(CPACK_RPM_PACKAGE_VENDOR ${VIEWER_CHANNEL} + CACHE STRING "RPM package vendor.") + set(CPACK_RPM_PACKAGE_URL + https://${VIEWER_PACKAGE_DOMAIN_NAME} + CACHE STRING "RPM package URL.") + set(CPACK_RPM_PACKAGE_DESCRIPTION ${VIEWER_PACKAGE_DESCRIPTION} + CACHE STRING "RPM package description.") + if (${LINUX_DISTRO} MATCHES fedora) + set(CPACK_RPM_PACKAGE_REQUIRES + "apr-util, boost-fiber, boost-program-options, boost-regex, boost-thread, collada-dom, expat, fltk, mesa-libGLU, hunspell, libnghttp2, openjpeg2, SDL2, uriparser, vlc-libs, vlc-plugins-base, libvorbis, xmlrpc-epi" + CACHE STRING "RPM package requirements.") + elseif (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) + endif (${LINUX_DISTRO} MATCHES fedora) + endif (${LINUX_DISTRO} MATCHES debian OR ${LINUX_DISTRO} MATCHES ubuntu) + endif (PACKAGE) + else (USESYSTEMLIBS) set(product SecondLife-${ARCH}-${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}) # These are the generated targets that are copied to package/ @@ -2115,10 +2192,51 @@ if (LINUX) add_dependencies(llpackage copy_l_viewer_manifest) check_message_template(llpackage) endif (PACKAGE) + endif (USESYSTEMLIBS) +elseif (USESYSTEMLIBS) + add_custom_command( + TARGET ${VIEWER_BINARY_NAME} POST_BUILD + COMMAND sed + ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND sed + ARGS -i '' -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND sed + ARGS -i '' -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND sed + ARGS -i '' -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND sed + ARGS -i '' -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND sed + ARGS -i '' -e '/^ .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND sort + ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt + COMMAND paste + ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt + COMMAND sed + ARGS -i '' -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt + ) + if (CMAKE_SYSTEM_NAME MATCHES FreeBSD AND PACKAGE) + set(CPACK_BINARY_FREEBSD ON CACHE BOOL "Able to package FreeBSD PKG.") + set(CPACK_FREEBSD_PACKAGE_COMMENT ${VIEWER_PACKAGE_COMMENT} + CACHE STRING "FreeBSD package comment.") + set(CPACK_FREEBSD_PACKAGE_DESCRIPTION ${VIEWER_PACKAGE_DESCRIPTION} + CACHE STRING "FreeBSD package description.") + set(CPACK_FREEBSD_PACKAGE_WWW + https://${VIEWER_PACKAGE_DOMAIN_NAME} + CACHE STRING "FreeBSD package WWW.") + set(CPACK_FREEBSD_PACKAGE_LICENSE LGPL21 + CACHE STRING "FreeBSD package license.") + set(CPACK_FREEBSD_PACKAGE_MAINTAINER + $ENV{USER}@${VIEWER_PACKAGE_DOMAIN_NAME} + CACHE STRING "FreeBSD package maintainer.") + set(CPACK_FREEBSD_PACKAGE_ORIGIN net/${VIEWER_BINARY_NAME} + CACHE STRING "FreeBSD package origin.") + set(CPACK_FREEBSD_PACKAGE_DEPS + "audio/freealut;devel/collada-dom;graphics/libGLU;textproc/hunspell;misc/meshoptimizer;www/libnghttp2;graphics/openjpeg;net/uriparser;multimedia/vlc;audio/libvorbis;net/xmlrpc-epi" + CACHE STRING "FreeBSD package dependencies.") + endif (CMAKE_SYSTEM_NAME MATCHES FreeBSD AND PACKAGE) endif (LINUX) -endif (NOT USESYSTEMLIBS) - if (DARWIN) # These all get set with PROPERTIES. It's not that the property names are # magically known to CMake -- it's that these names are referenced in the @@ -2132,13 +2250,13 @@ if (DARWIN) set(MACOSX_BUNDLE_BUNDLE_NAME "Megapahit") set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") - set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Megapahit. 2024") + set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Megapahit 2024") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "LLApplication") # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ set(CMAKE_MACOSX_RPATH 1) - + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES @@ -2150,6 +2268,7 @@ if (DARWIN) LINK_FLAGS "-rpath @loader_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}" + MACOSX_BUNDLE TRUE ) set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/${product}.app") @@ -2160,9 +2279,19 @@ if (DARWIN) "${VIEWER_APP_BUNDLE}/Contents/Info.plist" ) - if (INSTALL) - install(PROGRAMS ${VIEWER_APP_EXE} DESTINATION ../MacOS) - else (INSTALL) + if (USESYSTEMLIBS) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/English.lproj/InfoPlist.strings + ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings + ) + add_custom_command( + TARGET ${VIEWER_BINARY_NAME} POST_BUILD + COMMAND ${CMAKE_INSTALL_NAME_TOOL} + -change "/usr/local/lib/libxmlrpc-epi.0.dylib" "${AUTOBUILD_INSTALL_DIR}/lib/release/libxmlrpc-epi.0.dylib" + ${VIEWER_APP_EXE} + VERBATIM + ) + else (USESYSTEMLIBS) add_custom_command( TARGET ${VIEWER_BINARY_NAME} POST_BUILD COMMAND ${PYTHON_EXECUTABLE} @@ -2186,13 +2315,11 @@ if (DARWIN) ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) - endif (INSTALL) + endif (USESYSTEMLIBS) - if (ENABLE_MEDIA_PLUGINS) + if (ENABLE_MEDIA_PLUGINS) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_cef) - else (ENABLE_MEDIA_PLUGINS) - add_dependencies(${VIEWER_BINARY_NAME} SLPlugin) - endif (ENABLE_MEDIA_PLUGINS) + endif () if (ENABLE_SIGNING) set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}") @@ -2252,6 +2379,9 @@ endif (DARWIN) if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) +if (PACKAGE AND USESYSTEMLIBS) + include(CPack) +endif (PACKAGE AND USESYSTEMLIBS) if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIEWER_SYMBOL_FILE) if (USE_BUGSPLAT) @@ -2319,7 +2449,7 @@ if (LL_TESTS) # llremoteparcelrequest.cpp llviewerhelputil.cpp llversioninfo.cpp -# llvocache.cpp +# llvocache.cpp llworldmap.cpp llworldmipmap.cpp ) @@ -2328,7 +2458,7 @@ if (LL_TESTS) llworldmap.cpp llworldmipmap.cpp PROPERTIES - LL_TEST_ADDITIONAL_SOURCE_FILES + LL_TEST_ADDITIONAL_SOURCE_FILES tests/llviewertexture_stub.cpp #llviewertexturelist.cpp ) @@ -2362,7 +2492,7 @@ if (LL_TESTS) llworldmap.cpp llworldmipmap.cpp PROPERTIES - LL_TEST_ADDITIONAL_SOURCE_FILES + LL_TEST_ADDITIONAL_SOURCE_FILES tests/llviewertexture_stub.cpp ) diff --git a/indra/newview/FixBundle.cmake.in b/indra/newview/FixBundle.cmake.in index 6d343680d9..b0d23c712c 100644 --- a/indra/newview/FixBundle.cmake.in +++ b/indra/newview/FixBundle.cmake.in @@ -32,11 +32,6 @@ file(CREATE_LINK SYMBOLIC ) file(CREATE_LINK - "../../../../Frameworks/libmeshoptimizer.dylib" - "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libmeshoptimizer.dylib" - SYMBOLIC - ) -file(CREATE_LINK "../../../../Frameworks/libaprutil-1.0.dylib" "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libaprutil-1.0.dylib" SYMBOLIC diff --git a/indra/newview/FixPackage.cmake.in b/indra/newview/FixPackage.cmake.in index 167519edd3..fc8cae1d19 100644 --- a/indra/newview/FixPackage.cmake.in +++ b/indra/newview/FixPackage.cmake.in @@ -32,11 +32,6 @@ file(CREATE_LINK SYMBOLIC ) file(CREATE_LINK - "../../../../Frameworks/libmeshoptimizer.dylib" - "${CMAKE_CACHEFILE_DIR}/_CPack_Packages/${CMAKE_SYSTEM_NAME}/Bundle/${CPACK_BUNDLE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}/${CPACK_BUNDLE_NAME}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libmeshoptimizer.dylib" - SYMBOLIC - ) -file(CREATE_LINK "../../../../Frameworks/libaprutil-1.0.dylib" "${CMAKE_CACHEFILE_DIR}/_CPack_Packages/${CMAKE_SYSTEM_NAME}/Bundle/${CPACK_BUNDLE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}/${CPACK_BUNDLE_NAME}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libaprutil-1.0.dylib" SYMBOLIC diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index b468f1af99..5c4c08dc9d 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -1,61 +1,7 @@ -if (LINUX) - add_custom_command( - OUTPUT contributors.txt - COMMAND ${CMAKE_SYSROOT}/usr/bin/sed - ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND ${CMAKE_SYSROOT}/usr/bin/sed - ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND ${CMAKE_SYSROOT}/usr/bin/sed - ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND ${CMAKE_SYSROOT}/usr/bin/sed - ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND ${CMAKE_SYSROOT}/usr/bin/sed - ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND ${CMAKE_SYSROOT}/usr/bin/sed - ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^ .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND sort - ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND paste - ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt - COMMAND ${CMAKE_SYSROOT}/usr/bin/sed - ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt - ) -else (LINUX) - add_custom_command( - OUTPUT contributors.txt - COMMAND sed - ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND sed - ARGS -i '' -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND sed - ARGS -i '' -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND sed - ARGS -i '' -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND sed - ARGS -i '' -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND sed - ARGS -i '' -e '/^ .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND sort - ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt - COMMAND paste - ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt - COMMAND sed - ARGS -i '' -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt - ) -endif (LINUX) - -add_custom_target(contributors ALL - DEPENDS contributors.txt - ) - if (DARWIN) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/English.lproj/InfoPlist.strings - ${VIEWER_APP_BUNDLE}/Contents/Resources/English.lproj/InfoPlist.strings - ) - install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings ${CMAKE_CURRENT_SOURCE_DIR}/English.lproj/language.txt DESTINATION English.lproj ) @@ -184,7 +130,7 @@ if (LINUX) install(FILES ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so.13 - ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so.13.22 + ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so.13.23 DESTINATION ${_LIB}) endif (USE_FMODSTUDIO) install(PROGRAMS diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index cc4ac25a06..4d295eac53 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13830,8 +13830,8 @@ OpenGL buffer mapping mode: 0:auto 1:normal - 2:optimised - 3:experimental.</string> + 2:MP optimised + 3:LL optimized.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> diff --git a/indra/newview/fsfloatersearch.cpp b/indra/newview/fsfloatersearch.cpp index 3f79ee7f4b..7e0a873452 100644 --- a/indra/newview/fsfloatersearch.cpp +++ b/indra/newview/fsfloatersearch.cpp @@ -760,7 +760,7 @@ void FSFloaterSearch::onBtnTeleport() { if (!mParcelGlobal.isExactlyZero()) { - gAgent.teleportViaLocation(mParcelGlobal); + gAgent.teleportViaLocationLookAt(mParcelGlobal); LLFloaterWorldMap::getInstance()->trackLocation(mParcelGlobal); /// <FS:CR> What should we do when when we teleport? The default (1) is to close the floater, /// the user may elect to minimize the floater (2), or to do nothing (any other setting) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c93a3f6d0d..2459f49952 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3309,7 +3309,7 @@ LLSD LLAppViewer::getViewerInfo() const url = LLTrans::getString("RELEASE_NOTES_BASE_URL"); if (!LLStringUtil::endsWith(url, "/")) url += "/"; - url += "#" + LLURI::escape(versionInfo.getVersion()); // + ".html"; + url += LLURI::escape(versionInfo.getVersion()) + ".html"; } info["VIEWER_RELEASE_NOTES_URL"] = url; diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 8f858fe4e1..a7c718de82 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -36,6 +36,7 @@ #include "lltextutil.h" // newview +#include "llagent.h" #include "llagentdata.h" // for comparator #include "llavatariconctrl.h" #include "llavatarnamecache.h" @@ -47,6 +48,7 @@ #include "llvoiceclient.h" #include "llviewercontrol.h" // for gSavedSettings #include "lltooldraganddrop.h" +#include "llworld.h" static LLDefaultChildRegistry::Register<LLAvatarList> r("avatar_list"); @@ -119,6 +121,7 @@ static const LLFlatListView::ItemReverseComparator REVERSE_NAME_COMPARATOR(NAME_ LLAvatarList::Params::Params() : ignore_online_status("ignore_online_status", false) +, show_avatar_distance("show_avatar_distance", false) , show_last_interaction_time("show_last_interaction_time", false) , show_info_btn("show_info_btn", true) , show_profile_btn("show_profile_btn", true) @@ -131,6 +134,7 @@ LLAvatarList::LLAvatarList(const Params& p) : LLFlatListViewEx(p) , mIgnoreOnlineStatus(p.ignore_online_status) , mShowLastInteractionTime(p.show_last_interaction_time) +, mAvatarDistance(p.show_avatar_distance) , mContextMenu(NULL) , mDirty(true) // to force initial update , mNeedUpdateNames(false) @@ -147,7 +151,7 @@ LLAvatarList::LLAvatarList(const Params& p) // Set default sort order. setComparator(&NAME_COMPARATOR); - if (mShowLastInteractionTime) + if (mShowLastInteractionTime || mAvatarDistance) { mLITUpdateTimer = new LLTimer(); mLITUpdateTimer->setTimerExpirySec(0); // zero to force initial update @@ -196,9 +200,16 @@ void LLAvatarList::draw() if (mDirty) refresh(); - if (mShowLastInteractionTime && mLITUpdateTimer->hasExpired()) + if ((mShowLastInteractionTime || mAvatarDistance) && mLITUpdateTimer->hasExpired()) { + if (mAvatarDistance) + { + updateAvatarDistance(); + } + if (mShowLastInteractionTime) + { updateLastInteractionTimes(); + } mLITUpdateTimer->setTimerExpirySec(LIT_UPDATE_PERIOD); // restart the timer } } @@ -422,6 +433,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, bool is // This sets the name as a side effect item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); + item->showAvatarDistance(mAvatarDistance); item->showLastInteractionTime(mShowLastInteractionTime); item->setAvatarIconVisible(mShowIcons); @@ -528,6 +540,28 @@ void LLAvatarList::computeDifference( LLCommonUtils::computeDifference(vnew_unsorted, vcur, vadded, vremoved); } +void LLAvatarList::updateAvatarDistance() +{ + std::vector<LLPanel*> items; + getItems(items); + auto uuids = getIDs(); + std::vector<LLVector3d> positions; + auto me_pos = gAgent.getPositionGlobal(); + LLWorld::getInstance()->getAvatars(&uuids, &positions, me_pos, gSavedSettings.getF32("MPVNearMeRange")); + std::map <LLUUID, LLVector3d> avatarsPositions; + auto pos_it = positions.begin(); + auto id_it = uuids.begin(); + for (;pos_it != positions.end() && id_it != uuids.end(); ++pos_it, ++id_it) + { + avatarsPositions[*id_it] = *pos_it; + } + for (auto it = items.begin(); it != items.end(); it++) + { + auto item = static_cast<LLAvatarListItem*>(*it); + item->setAvatarDistance(dist_vec(avatarsPositions[item->getAvatarId()], me_pos)); + } +} + // Refresh shown time of our last interaction with all listed avatars. void LLAvatarList::updateLastInteractionTimes() { diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index af5bfefcde..81486690c9 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -50,6 +50,7 @@ public: struct Params : public LLInitParam::Block<Params, LLFlatListViewEx::Params> { Optional<bool> ignore_online_status, // show all items as online + show_avatar_distance, show_last_interaction_time, // show most recent interaction time. *HACK: move this to a derived class show_info_btn, show_profile_btn, @@ -110,6 +111,7 @@ protected: const uuid_vec_t& vnew, uuid_vec_t& vadded, uuid_vec_t& vremoved); + void updateAvatarDistance(); void updateLastInteractionTimes(); void rebuildNames(); void onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask); @@ -118,6 +120,7 @@ protected: private: bool mIgnoreOnlineStatus; + bool mAvatarDistance; bool mShowLastInteractionTime; bool mDirty; bool mNeedUpdateNames; diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 880910d18e..dd9365da57 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -65,6 +65,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) LLFriendObserver(), mAvatarIcon(NULL), mAvatarName(NULL), + mAvatarDistance(NULL), mLastInteractionTime(NULL), mIconPermissionOnline(NULL), mIconPermissionMap(NULL), @@ -107,6 +108,7 @@ bool LLAvatarListItem::postBuild() { mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon"); mAvatarName = getChild<LLTextBox>("avatar_name"); + mAvatarDistance = getChild<LLTextBox>("avatar_distance"); mLastInteractionTime = getChild<LLTextBox>("last_interaction"); mIconPermissionOnline = getChild<LLIconCtrl>("permission_online_icon"); @@ -301,6 +303,17 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, b } } +void LLAvatarListItem::showAvatarDistance(bool show) +{ + mAvatarDistance->setVisible(show); + updateChildren(); +} + +void LLAvatarListItem::setAvatarDistance(F32 distance) +{ + mAvatarDistance->setValue(llformat("%.1f m", distance)); +} + void LLAvatarListItem::showLastInteractionTime(bool show) { mLastInteractionTime->setVisible(show); @@ -538,6 +551,9 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) // last interaction time textbox width + padding S32 last_interaction_time_width = avatar_item->mIconPermissionEditTheirs->getRect().mLeft - avatar_item->mLastInteractionTime->getRect().mLeft; + // avatar distance textbox width + padding + S32 avatar_distance_width = avatar_item->mAvatarDistance->getRect().mLeft - avatar_item->mAvatarName->getRect().mLeft; + // avatar icon width + padding S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft; @@ -546,6 +562,7 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) S32 index = ALIC_COUNT; sChildrenWidths[--index] = icon_width; sChildrenWidths[--index] = 0; // for avatar name we don't need its width, it will be calculated as "left available space" + sChildrenWidths[--index] = avatar_distance_width; sChildrenWidths[--index] = last_interaction_time_width; sChildrenWidths[--index] = permission_edit_theirs_width; sChildrenWidths[--index] = permission_edit_mine_width; @@ -666,6 +683,9 @@ LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_ case ALIC_NAME: child_view = mAvatarName; break; + case ALIC_DISTANCE: + child_view = mAvatarDistance; + break; case ALIC_INTERACTION_TIME: child_view = mLastInteractionTime; break; diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 2e4c597d30..d49b131528 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -98,12 +98,14 @@ public: void setHighlight(const std::string& highlight); void setState(EItemState item_style); void setAvatarId(const LLUUID& id, const LLUUID& session_id, bool ignore_status_changes = false, bool is_resident = true); + void setAvatarDistance(F32 distance); void setLastInteractionTime(U32 secs_since); //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly void setShowProfileBtn(bool show); void setShowInfoBtn(bool show); void showSpeakingIndicator(bool show); void setShowPermissions(bool show) { mShowPermissions = show; }; + void showAvatarDistance(bool show); void showLastInteractionTime(bool show); void setAvatarIconVisible(bool visible); void setShowCompleteName(bool show) { mShowCompleteName = show;}; @@ -158,6 +160,7 @@ private: ALIC_PERMISSION_EDIT_MINE, ALIC_PERMISSION_EDIT_THEIRS, ALIC_INTERACTION_TIME, + ALIC_DISTANCE, ALIC_NAME, ALIC_ICON, ALIC_COUNT, @@ -199,6 +202,7 @@ private: LLView* getItemChildView(EAvatarListItemChildIndex child_index); LLTextBox* mAvatarName; + LLTextBox* mAvatarDistance; LLTextBox* mLastInteractionTime; LLStyle::Params mAvatarNameStyle; diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index a471daf24e..282a273be6 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -404,7 +404,7 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) relnotes = LLTrans::getString("RELEASE_NOTES_BASE_URL"); if (!LLStringUtil::endsWith(relnotes, "/")) relnotes += "/"; - relnotes += "#" + LLURI::escape(login_version); // + ".html"; + relnotes += LLURI::escape(login_version) + ".html"; } if (gViewerWindow) diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index e8d64cabf6..5fee254354 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -289,7 +289,9 @@ void LLVoiceClient::setNonSpatialVoiceModule(const std::string &voice_server_typ void LLVoiceClient::setHidden(bool hidden) { +#if !__FreeBSD__ LLWebRTCVoiceClient::getInstance()->setHidden(hidden); +#endif LLVivoxVoiceClient::getInstance()->setHidden(hidden); } diff --git a/indra/newview/skins/default/xui/en/floater_mp_performance.xml b/indra/newview/skins/default/xui/en/floater_mp_performance.xml index 06dc4cabc6..d943a13f66 100644 --- a/indra/newview/skins/default/xui/en/floater_mp_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_mp_performance.xml @@ -66,7 +66,7 @@ height="15" left="2" top="8"> - Buffer mapping + Optimisations: (needs restart): </text> @@ -85,13 +85,13 @@ value="1" /> <combo_box.item enabled="true" - label="Optimized (Apple GPU)" - name="Optimized" + label="Apple GPU (smoothie)" + name="Megapahit Optimisations" value="2" /> <combo_box.item enabled="true" - label="Experimental" - name="Experimental" + label="Apple GPU (LL)" + name="LL Optimisations" value="3" /> </combo_box> diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index ca6e94397d..122b5ae508 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -66,6 +66,17 @@ value="(loading)" width="180" /> <text + follows="left|right" + font="SansSerifSmall" + height="15" + layout="topleft" + left_pad="5" + name="avatar_distance" + top="6" + text_color="LtGray_50" + value="0m" + width="35" /> + <text follows="right" font="SansSerifSmall" height="15" diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index c31e6c94ea..199609d57d 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -223,6 +223,7 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip keep_one_selected="false" multi_select="true" name="avatar_list" + show_avatar_distance="true" right="-1" top="2" /> </layout_panel> |