diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-08-14 20:59:49 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-08-14 20:59:49 +0800 |
commit | 2d4b9cf9854fa8928f4dd16d7acc24f9aa4f70e9 (patch) | |
tree | b28c89df68d2bbf1090e979b7a5c2a32b293bead /indra/cmake | |
parent | ce8cb73ac37ce59a76c3ebfa684e8f1c94e8fd13 (diff) | |
parent | d831010b59d83fccc64d00c48d13447bfcbb7bcd (diff) |
Merge branch 'main' into webrtc-voice
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/BuildVersion.cmake | 6 | ||||
-rw-r--r-- | indra/cmake/CEFPlugin.cmake | 43 | ||||
-rw-r--r-- | indra/cmake/CURL.cmake | 98 | ||||
-rw-r--r-- | indra/cmake/FMODSTUDIO.cmake | 80 | ||||
-rw-r--r-- | indra/cmake/LibVLCPlugin.cmake | 37 | ||||
-rw-r--r-- | indra/cmake/Meshoptimizer.cmake | 65 | ||||
-rw-r--r-- | indra/cmake/NDOF.cmake | 38 | ||||
-rw-r--r-- | indra/cmake/OpenJPEG.cmake | 41 | ||||
-rw-r--r-- | indra/cmake/OpenSSL.cmake | 154 | ||||
-rw-r--r-- | indra/cmake/UnixInstall.cmake | 92 | ||||
-rw-r--r-- | indra/cmake/Variables.cmake | 3 | ||||
-rw-r--r-- | indra/cmake/ViewerMiscLibs.cmake | 28 | ||||
-rw-r--r-- | indra/cmake/XmlRpcEpi.cmake | 85 |
13 files changed, 628 insertions, 142 deletions
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..5efa9b61b0 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 + 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 + 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 + 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 39636d7522..a8bf087ece 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -30,16 +30,14 @@ 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 (USESYSTEMLIBS) + if (USESYSTEMLIBS AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/fmodstudio_installed OR NOT ${fmodstudio_installed} EQUAL 0)) if (DARWIN) execute_process( - COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/fmodstudioapi20223mac-installer.dmg - COMMAND mkdir -p - ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio - ${AUTOBUILD_INSTALL_DIR}/lib/release + COMMAND hdiutil attach -noverify fmodstudioapi20223mac-installer.dmg + WORKING_DIRECTORY $ENV{HOME}/Downloads ) - execute_process( - COMMAND cp + 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 @@ -48,47 +46,51 @@ if (USE_FMODSTUDIO) /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 - ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio/ - COMMAND cp - /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/lib/libfmod.dylib - ${AUTOBUILD_INSTALL_DIR}/lib/release/ + DESTINATION ${LIBS_PREBUILT_DIR}/include/fmodstudio ) execute_process( - COMMAND hdiutil detach /Volumes/FMOD\ Programmers\ API\ Mac - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - RESULT_VARIABLE ${_binary}_installed + 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 ) - else (DARWIN) execute_process( - COMMAND tar -xf $ENV{HOME}/Downloads/fmodstudioapi20223linux.tar.gz -C /tmp - COMMAND mkdir -p ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio + COMMAND hdiutil detach FMOD\ Programmers\ API\ Mac + WORKING_DIRECTORY /Volumes + RESULT_VARIABLE fmodstudio_installed ) - execute_process( - COMMAND cp - /tmp/fmodstudioapi20223linux/api/core/inc/fmod.h - /tmp/fmodstudioapi20223linux/api/core/inc/fmod.hpp - /tmp/fmodstudioapi20223linux/api/core/inc/fmod_codec.h - /tmp/fmodstudioapi20223linux/api/core/inc/fmod_common.h - /tmp/fmodstudioapi20223linux/api/core/inc/fmod_dsp.h - /tmp/fmodstudioapi20223linux/api/core/inc/fmod_dsp_effects.h - /tmp/fmodstudioapi20223linux/api/core/inc/fmod_errors.h - /tmp/fmodstudioapi20223linux/api/core/inc/fmod_output.h - ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio/ - COMMAND cp -P - /tmp/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so - /tmp/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so.13 - /tmp/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so.13.23 - ${AUTOBUILD_INSTALL_DIR}/lib/release/ + 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} ) - execute_process( - COMMAND rm -rf /tmp/fmodstudioapi20223linux - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - RESULT_VARIABLE ${_binary}_installed + 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) + 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 (USESYSTEMLIBS) + 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) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index e2ecb8b248..779576a485 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -6,15 +6,36 @@ include_guard() add_library( ll::libvlc INTERFACE IMPORTED ) if (USESYSTEMLIBS) - if (DARWIN) if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) - execute_process(COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/vlc-3.0.21-arm64.dmg) - elseif (CMAKE_OSX_ARCHITECTURES MATCHES x86_64) - execute_process(COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/vlc-3.0.21-intel64.dmg) - else () - execute_process(COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/vlc-3.0.21-universal.dmg) - endif () + 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 ) @@ -28,13 +49,11 @@ if (USESYSTEMLIBS) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") return() - else (USESYSTEMLIBS) use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") - endif (USESYSTEMLIBS) if (WINDOWS) diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake index a1cf81be80..a47c59c96b 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 DARWIN)) + find_package(meshoptimizer) + target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer) + endif (NOT (${LINUX_DISTRO} MATCHES fedora OR DARWIN)) +endif (NOT USESYSTEMLIBS) + +if (${LINUX_DISTRO} MATCHES fedora 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 "${meshoptimizer_installed}") + 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 DARWIN OR NOT USESYSTEMLIBS) diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index 326ef26c2c..456507e1bd 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 "${libndofdev_installed}") + 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..d2c9d95c9b 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 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 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 DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)) +use_prebuilt_binary(openjpeg) + if (EXISTS ${LIBS_PREBUILT_DIR}/include/openjpeg) + file(RENAME + ${LIBS_PREBUILT_DIR}/include/openjpeg + ${LIBS_PREBUILT_DIR}/include/openjpeg-2.5 + ) + endif (EXISTS ${LIBS_PREBUILT_DIR}/include/openjpeg) target_link_libraries(ll::openjpeg INTERFACE openjp2 ) +endif (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora 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/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 ab8add8af8..59368e1177 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 fad95beae8..c3dcf1ddb2 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -16,7 +16,33 @@ if (NOT USESYSTEMLIBS) use_prebuilt_binary(slvoice) use_prebuilt_binary(nanosvg) +elseif (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu) 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/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 994df3d128..c49fe6bc9a 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -4,20 +4,85 @@ 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 (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) + 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 --host=aarch64-apple-darwin + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2 + ) + else (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + execute_process( + COMMAND ./configure --host=${CMAKE_OSX_ARCHITECTURES}-apple-darwin + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2 + ) + endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + 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}) + unset(ENV{CFLAGS}) + 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) - 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 ${LIBS_PREBUILT_DIR}/include/xmlrpc-epi) +elseif (LINUX) + target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${CMAKE_SYSROOT}/usr/include/xmlrpc-epi) endif () |