diff options
Diffstat (limited to 'indra/cmake')
29 files changed, 202 insertions, 253 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 4471380c6b..4b3fa00fcf 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -32,6 +32,10 @@ add_compile_definitions( ADDRESS_SIZE=${ADDRESS_SIZE}) # -- which we do. Without one or the other, we get a ton of Boost warnings. add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS) +# Force enable SSE2 instructions in GLM per the manual +# https://github.com/g-truc/glm/blob/master/manual.md#section2_10 +add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1) + # Configure crash reporting set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds") set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds") @@ -60,9 +64,7 @@ if (WINDOWS) # http://www.cmake.org/pipermail/cmake/2009-September/032143.html string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - # zlib has assembly-language object files incompatible with SAFESEH add_link_options(/LARGEADDRESSAWARE - /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099) @@ -104,10 +106,8 @@ if (WINDOWS) string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") endif() - # workaround for github runner image breakage: - # https://github.com/actions/runner-images/issues/10004#issuecomment-2153445161 - # can be removed after the above issue is resolved and deployed across GHA - add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) + # Allow use of sprintf etc + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif (WINDOWS) @@ -187,6 +187,10 @@ if (LINUX OR DARWIN) list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor ) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13) + list(APPEND GCC_WARNINGS -Wno-unused-but-set-variable -Wno-unused-variable ) + endif() + add_compile_options(${GCC_WARNINGS}) add_compile_options(-m${ADDRESS_SIZE}) endif (LINUX OR DARWIN) diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 21139319c3..97b316c4c7 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -18,6 +18,7 @@ if (WINDOWS) ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib ) + target_compile_definitions( ll::apr INTERFACE APR_DECLARE_STATIC=1 APU_DECLARE_STATIC=1 API_DECLARE_STATIC=1) elseif (DARWIN) if (LLCOMMON_LINK_SHARED) set(APR_selector "0.dylib") @@ -28,16 +29,15 @@ elseif (DARWIN) endif (LLCOMMON_LINK_SHARED) target_link_libraries( ll::apr INTERFACE - libapr-1.${APR_selector} - libaprutil-1.${APRUTIL_selector} + ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.${APR_selector} + ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.${APR_selector} iconv ) -else (WINDOWS) +else() target_link_libraries( ll::apr INTERFACE - apr-1 - aprutil-1 - uuid + ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a rt ) -endif (WINDOWS) +endif () target_include_directories( ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/apr-1 ) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 38547bb017..8c82749cab 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -1,4 +1,5 @@ # -*- cmake -*- +include(Linking) include(Prebuilt) include_guard() @@ -9,8 +10,22 @@ use_prebuilt_binary(ogg_vorbis) target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) if (WINDOWS) - target_link_libraries(ll::vorbis INTERFACE ogg_static vorbis_static vorbisenc_static vorbisfile_static ) + target_link_libraries(ll::vorbis INTERFACE + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.lib + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libogg.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.lib + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisenc.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.lib + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisfile.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.lib + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib + ) else (WINDOWS) - target_link_libraries(ll::vorbis INTERFACE ogg vorbis vorbisenc vorbisfile ) + target_link_libraries(ll::vorbis INTERFACE + ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.a + ) endif (WINDOWS) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 601a23a86d..8c5b946753 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -24,7 +24,8 @@ if (WINDOWS) libboost_program_options-mt${addrsfx} libboost_regex-mt${addrsfx} libboost_system-mt${addrsfx} - libboost_thread-mt${addrsfx}) + libboost_thread-mt${addrsfx} + libboost_url-mt${addrsfx}) elseif (LINUX) target_link_libraries( ll::boost INTERFACE boost_context-mt${addrsfx} @@ -34,7 +35,8 @@ elseif (LINUX) boost_regex-mt${addrsfx} boost_signals-mt${addrsfx} boost_system-mt${addrsfx} - boost_thread-mt${addrsfx}) + boost_thread-mt${addrsfx} + boost_url-mt${addrsfx}) elseif (DARWIN) target_link_libraries( ll::boost INTERFACE boost_context-mt${addrsfx} @@ -43,7 +45,8 @@ elseif (DARWIN) boost_program_options-mt${addrsfx} boost_regex-mt${addrsfx} boost_system-mt${addrsfx} - boost_thread-mt${addrsfx}) + boost_thread-mt${addrsfx} + boost_url-mt${addrsfx}) endif (WINDOWS) if (LINUX) diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index df05032172..73b614e0af 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -23,14 +23,11 @@ set(cmake_SOURCE_FILES DragDrop.cmake EXPAT.cmake FindAutobuild.cmake - FMODSTUDIO.cmake FreeType.cmake GLEXT.cmake GLH.cmake - GoogleMock.cmake Havok.cmake Hunspell.cmake - JsonCpp.cmake LLAddBuildTest.cmake LLAppearance.cmake LLAudio.cmake @@ -60,12 +57,11 @@ set(cmake_SOURCE_FILES Tut.cmake UI.cmake UnixInstall.cmake - URIPARSER.cmake Variables.cmake ViewerMiscLibs.cmake VisualLeakDetector.cmake LibVLCPlugin.cmake - XmlRpcEpi.cmake + WebRTC.cmake xxHash.cmake ZLIBNG.cmake ) diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index b9f685f37b..eea0a2da62 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) include_guard() add_library( ll::libcurl INTERFACE IMPORTED ) @@ -7,8 +8,18 @@ add_library( ll::libcurl INTERFACE IMPORTED ) use_system_binary(libcurl) use_prebuilt_binary(curl) if (WINDOWS) - target_link_libraries(ll::libcurl INTERFACE libcurl.lib) -else (WINDOWS) - target_link_libraries(ll::libcurl INTERFACE libcurl.a) -endif (WINDOWS) + target_link_libraries(ll::libcurl INTERFACE + ${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.lib + ll::openssl + ll::nghttp2 + ll::zlib-ng + ) +else () + target_link_libraries(ll::libcurl INTERFACE + ${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.a + ll::openssl + ll::nghttp2 + ll::zlib-ng + ) +endif () target_include_directories( ll::libcurl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 27b20ee3b1..c6b89e1de3 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -7,7 +7,6 @@ include(CMakeCopyIfDifferent) include(Linking) include(OPENAL) -include(FMODSTUDIO) # When we copy our dependent libraries, we almost always want to copy them to # both the Release and the RelWithDebInfo staging directories. This has @@ -50,26 +49,17 @@ if(WINDOWS) endif (ADDRESS_SIZE EQUAL 64) #******************************* - # Misc shared libs + # Misc shared libs set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(release_files openjp2.dll - libapr-1.dll - libaprutil-1.dll - nghttp2.dll - libhunspell.dll - uriparser.dll ) - # OpenSSL - if(ADDRESS_SIZE EQUAL 64) - set(release_files ${release_files} libcrypto-1_1-x64.dll) - set(release_files ${release_files} libssl-1_1-x64.dll) - else(ADDRESS_SIZE EQUAL 64) - set(release_files ${release_files} libcrypto-1_1.dll) - set(release_files ${release_files} libssl-1_1.dll) - endif(ADDRESS_SIZE EQUAL 64) + if(LLCOMMON_LINK_SHARED) + set(release_files ${release_files} libapr-1.dll) + set(release_files ${release_files} libaprutil-1.dll) + endif() # Filenames are different for 32/64 bit BugSplat file and we don't # have any control over them so need to branch. @@ -85,12 +75,6 @@ if(WINDOWS) endif(ADDRESS_SIZE EQUAL 32) endif (USE_BUGSPLAT) - if (TARGET ll::fmodstudio) - # fmodL is included for logging, only one should be picked by manifest - set(release_files ${release_files} fmodL.dll) - set(release_files ${release_files} fmod.dll) - endif () - if (TARGET ll::openal) list(APPEND release_files openal32.dll alut.dll) endif () @@ -105,14 +89,27 @@ if(WINDOWS) set(MSVC_VER 120) elseif (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920) # Visual Studio 2017 set(MSVC_VER 140) + set(MSVC_TOOLSET_VER 141) elseif (MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930) # Visual Studio 2019 set(MSVC_VER 140) + set(MSVC_TOOLSET_VER 142) elseif (MSVC_VERSION GREATER_EQUAL 1930 AND MSVC_VERSION LESS 1950) # Visual Studio 2022 set(MSVC_VER 140) + set(MSVC_TOOLSET_VER 143) else (MSVC80) MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake") endif (MSVC80) + if (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR}) + if(ADDRESS_SIZE EQUAL 32) + set(redist_find_path "$ENV{VCTOOLSREDISTDIR}x86\\Microsoft.VC${MSVC_TOOLSET_VER}.CRT") + else(ADDRESS_SIZE EQUAL 32) + set(redist_find_path "$ENV{VCTOOLSREDISTDIR}x64\\Microsoft.VC${MSVC_TOOLSET_VER}.CRT") + endif(ADDRESS_SIZE EQUAL 32) + get_filename_component(redist_path "${redist_find_path}" ABSOLUTE) + MESSAGE(STATUS "VC Runtime redist path: ${redist_path}") + endif (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR}) + if(ADDRESS_SIZE EQUAL 32) # this folder contains the 32bit DLLs.. (yes really!) set(registry_find_path "[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64") @@ -131,11 +128,23 @@ if(WINDOWS) # Check each of them. foreach(release_msvc_file msvcp${MSVC_VER}.dll + msvcp${MSVC_VER}_1.dll + msvcp${MSVC_VER}_2.dll + msvcp${MSVC_VER}_atomic_wait.dll + msvcp${MSVC_VER}_codecvt_ids.dll msvcr${MSVC_VER}.dll vcruntime${MSVC_VER}.dll vcruntime${MSVC_VER}_1.dll + vcruntime${MSVC_VER}_threads.dll ) - if(EXISTS "${registry_path}/${release_msvc_file}") + if(redist_path AND EXISTS "${redist_path}/${release_msvc_file}") + MESSAGE(STATUS "Copying redist file from ${redist_path}/${release_msvc_file}") + to_staging_dirs( + ${redist_path} + third_party_targets + ${release_msvc_file}) + elseif(EXISTS "${registry_path}/${release_msvc_file}") + MESSAGE(STATUS "Copying redist file from ${registry_path}/${release_msvc_file}") to_staging_dirs( ${registry_path} third_party_targets @@ -163,23 +172,20 @@ elseif(DARWIN) ) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(release_files - libapr-1.0.dylib - libapr-1.dylib - libaprutil-1.0.dylib - libaprutil-1.dylib - ${EXPAT_COPY} - libhunspell-1.3.0.dylib libndofdev.dylib - libnghttp2.dylib - libnghttp2.14.dylib - liburiparser.dylib - liburiparser.1.dylib - liburiparser.1.0.27.dylib ) - if (TARGET ll::fmodstudio) - set(debug_files ${debug_files} libfmodL.dylib) - set(release_files ${release_files} libfmod.dylib) + if(LLCOMMON_LINK_SHARED) + set(release_files ${release_files} + libapr-1.0.dylib + libapr-1.dylib + libaprutil-1.0.dylib + libaprutil-1.dylib + ) + endif() + + if (TARGET ll::openal) + list(APPEND release_files libalut.dylib libopenal.dylib) endif () elseif(LINUX) @@ -208,17 +214,13 @@ elseif(LINUX) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") # *FIX - figure out what to do with duplicate libalut.so here -brad set(release_files - ${EXPAT_COPY} - ) + ) if( USE_AUTOBUILD_3P ) list( APPEND release_files - libapr-1.so.0 - libaprutil-1.so.0 libatk-1.0.so libfreetype.so.6.6.2 libfreetype.so.6 - libhunspell-1.3.so.0.0.0 libopenjp2.so libuuid.so.16 libuuid.so.16.0.22 @@ -227,12 +229,14 @@ elseif(LINUX) libgmodule-2.0.so libgobject-2.0.so ) - endif() - if (TARGET ll::fmodstudio) - set(debug_files ${debug_files} "libfmodL.so") - set(release_files ${release_files} "libfmod.so") - endif () + if(LLCOMMON_LINK_SHARED) + set(release_files ${release_files} + libapr-1.so.0 + libaprutil-1.so.0 + ) + endif() + endif() else(WINDOWS) message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...") diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index 327fe8aa72..1a0b8789dc 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -7,14 +7,13 @@ add_library( ll::expat INTERFACE IMPORTED ) use_system_binary(expat) use_prebuilt_binary(expat) if (WINDOWS) - target_link_libraries( ll::expat INTERFACE libexpatMT ) - set(EXPAT_COPY libexpatMT.dll) -else (WINDOWS) - target_link_libraries( ll::expat INTERFACE expat ) - if (DARWIN) - set(EXPAT_COPY libexpat.1.dylib libexpat.dylib) - else () - set(EXPAT_COPY libexpat.so.1 libexpat.so) - endif () -endif (WINDOWS) + target_compile_definitions( ll::expat INTERFACE XML_STATIC=1) + target_link_libraries( ll::expat INTERFACE + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libexpatd.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libexpat.lib) +else () + target_link_libraries( ll::expat INTERFACE + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libexpat.a + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libexpat.a) +endif () target_include_directories( ll::expat SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake deleted file mode 100644 index 9a1cdff6cb..0000000000 --- a/indra/cmake/FMODSTUDIO.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# -*- cmake -*- - -include_guard() - -# FMODSTUDIO can be set when launching the make using the argument -DUSE_FMODSTUDIO:BOOL=ON -# When building using proprietary binaries though (i.e. having access to LL private servers), -# we always build with FMODSTUDIO. -if (INSTALL_PROPRIETARY) - set(USE_FMODSTUDIO ON CACHE BOOL "Using FMODSTUDIO sound library.") -endif (INSTALL_PROPRIETARY) - -# ND: To streamline arguments passed, switch from FMODSTUDIO to USE_FMODSTUDIO -# To not break all old build scripts convert old arguments but warn about it -if(FMODSTUDIO) - message( WARNING "Use of the FMODSTUDIO argument is deprecated, please switch to USE_FMODSTUDIO") - set(USE_FMODSTUDIO ${FMODSTUDIO}) -endif() - -if (USE_FMODSTUDIO) - add_library( ll::fmodstudio INTERFACE IMPORTED ) - target_compile_definitions( ll::fmodstudio INTERFACE LL_FMODSTUDIO=1) - - if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) - # If the path have been specified in the arguments, use that - - target_link_libraries(ll::fmodstudio INTERFACE ${FMODSTUDIO_LIBRARY}) - target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${FMODSTUDIO_INCLUDE_DIR}) - else (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) - # If not, we're going to try to get the package listed in autobuild.xml - # 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) - use_prebuilt_binary(fmodstudio) - if (WINDOWS) - target_link_libraries( ll::fmodstudio INTERFACE fmod_vc) - elseif (DARWIN) - #despite files being called libfmod.dylib, we are searching for fmod - target_link_libraries( ll::fmodstudio INTERFACE fmod) - elseif (LINUX) - target_link_libraries( ll::fmodstudio INTERFACE fmod) - endif (WINDOWS) - - target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/fmodstudio) - endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) -else() - set( USE_FMODSTUDIO "OFF") -endif () - diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 77140af641..563491556d 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) include_guard() add_library( ll::freetype INTERFACE IMPORTED ) @@ -7,5 +8,10 @@ add_library( ll::freetype INTERFACE IMPORTED ) use_system_binary(freetype) use_prebuilt_binary(freetype) target_include_directories( ll::freetype SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/freetype2/) -target_link_libraries( ll::freetype INTERFACE freetype ) + +if (WINDOWS) + target_link_libraries( ll::freetype INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/freetype.lib) +else() + target_link_libraries( ll::freetype INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libfreetype.a) +endif() diff --git a/indra/cmake/GLM.cmake b/indra/cmake/GLM.cmake new file mode 100644 index 0000000000..84b155f6c5 --- /dev/null +++ b/indra/cmake/GLM.cmake @@ -0,0 +1,7 @@ +# -*- cmake -*- +include(Prebuilt) + +add_library( ll::glm INTERFACE IMPORTED ) + +use_system_binary( glm ) +use_prebuilt_binary(glm) diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake deleted file mode 100644 index c3d195c37b..0000000000 --- a/indra/cmake/GoogleMock.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) -include(Linking) - -include_guard() - -add_library( ll::googlemock INTERFACE IMPORTED ) -if(USE_CONAN) - target_link_libraries( ll::googlemock INTERFACE CONAN_PKG::gtest ) - - #Not very nice, but for the moment we need this for tut.hpp - target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) - return() -endif() - -use_prebuilt_binary(googlemock) - -target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) - -if (LINUX) - # VWR-24366: gmock is underlinked, it needs gtest. - target_link_libraries( ll::googlemock INTERFACE gmock gtest) -elseif(WINDOWS) - target_link_libraries( ll::googlemock INTERFACE gmock) - target_include_directories( ll::googlemock SYSTEM INTERFACE - ${LIBS_PREBUILT_DIR}/include - ${LIBS_PREBUILT_DIR}/include/gmock) -elseif(DARWIN) - target_link_libraries( ll::googlemock INTERFACE gmock gtest) -endif(LINUX) - - diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index bb037c0237..129679febd 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -1,4 +1,5 @@ # -*- cmake -*- +include(Linking) include(Prebuilt) include_guard() @@ -8,10 +9,16 @@ add_library( ll::hunspell INTERFACE IMPORTED ) use_system_binary(hunspell) use_prebuilt_binary(libhunspell) if (WINDOWS) - target_link_libraries( ll::hunspell INTERFACE libhunspell) + target_compile_definitions( ll::hunspell INTERFACE HUNSPELL_STATIC=1) + target_link_libraries( ll::hunspell INTERFACE + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libhunspell.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell.lib + ) elseif(DARWIN) - target_link_libraries( ll::hunspell INTERFACE hunspell-1.3) + target_link_libraries( ll::hunspell INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell-1.7.a + ) elseif(LINUX) - target_link_libraries( ll::hunspell INTERFACE hunspell-1.3) + target_link_libraries( ll::hunspell INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell-1.7.a + ) endif() target_include_directories( ll::hunspell SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/hunspell) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index 252d7852d4..ade5a070cc 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -7,12 +7,14 @@ include_guard() add_library( ll::libjpeg INTERFACE IMPORTED ) use_system_binary(libjpeg) -use_prebuilt_binary(jpeglib) +use_prebuilt_binary(libjpeg-turbo) if (LINUX) - target_link_libraries( ll::libjpeg INTERFACE jpeg) + target_link_libraries( ll::libjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a) elseif (DARWIN) - target_link_libraries( ll::libjpeg INTERFACE jpeg) + target_link_libraries( ll::libjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a) elseif (WINDOWS) - target_link_libraries( ll::libjpeg INTERFACE jpeglib) + target_link_libraries( ll::libjpeg INTERFACE + debug ${ARCH_PREBUILT_DIRS_DEBUG}/jpeg.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/jpeg.lib) endif (LINUX) target_include_directories( ll::libjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake deleted file mode 100644 index 17f8e47a97..0000000000 --- a/indra/cmake/JsonCpp.cmake +++ /dev/null @@ -1,17 +0,0 @@ -# -*- cmake -*- - -include(Prebuilt) -include_guard() -add_library( ll::jsoncpp INTERFACE IMPORTED ) - -use_system_binary(jsoncpp) - -use_prebuilt_binary(jsoncpp) -if (WINDOWS) - target_link_libraries( ll::jsoncpp INTERFACE json_libmd.lib ) -elseif (DARWIN) - target_link_libraries( ll::jsoncpp INTERFACE libjson_darwin_libmt.a ) -elseif (LINUX) - target_link_libraries( ll::jsoncpp INTERFACE libjson_linux-gcc-4.1.3_libmt.a ) -endif (WINDOWS) -target_include_directories( ll::jsoncpp SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 2172b56da2..6408f1200c 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -1,7 +1,6 @@ # -*- cmake -*- include(00-Common) include(LLTestCommand) -include(GoogleMock) include(bugsplat) include(Tut) @@ -19,10 +18,6 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) # # More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code - # This here looks weird, but is needed. It will inject GoogleMock into projects that forgot to include `this` (LLAddBuildTest.cmake) - # But through some other means have access to this macro - include(GoogleMock) - if(LL_TEST_VERBOSE) message("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}") endif() @@ -41,7 +36,6 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) set(alltest_LIBRARIES llcommon - ll::googlemock ) if(NOT "${project}" STREQUAL "llmath") # add llmath as a dep unless the tested module *is* llmath! @@ -204,7 +198,6 @@ FUNCTION(LL_ADD_INTEGRATION_TEST set(libraries ${library_dependencies} - ll::googlemock ) # Add test executable build target diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake index 869d5805f2..dd43ca4916 100644 --- a/indra/cmake/LLCommon.cmake +++ b/indra/cmake/LLCommon.cmake @@ -6,6 +6,3 @@ include(EXPAT) include(Tracy) include(xxHash) include(ZLIBNG) -include(JsonCpp) - -include(XmlRpcEpi) diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 735f5e8052..d0a52ffb63 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -2,11 +2,11 @@ # these should be moved to their own cmake file include(Prebuilt) +include(Linking) include(Boost) include_guard() -add_library( ll::pcre INTERFACE IMPORTED ) add_library( ll::minizip-ng INTERFACE IMPORTED ) add_library( ll::libxml INTERFACE IMPORTED ) add_library( ll::colladadom INTERFACE IMPORTED ) @@ -22,21 +22,18 @@ use_system_binary( colladadom ) use_prebuilt_binary(colladadom) use_prebuilt_binary(minizip-ng) # needed for colladadom -use_prebuilt_binary(pcre) use_prebuilt_binary(libxml2) -target_link_libraries( ll::pcre INTERFACE pcrecpp pcre ) - if (WINDOWS) - target_link_libraries( ll::minizip-ng INTERFACE libminizip ) + target_link_libraries( ll::minizip-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/minizip.lib ) else() - target_link_libraries( ll::minizip-ng INTERFACE minizip ) + target_link_libraries( ll::minizip-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libminizip.a ) endif() if (WINDOWS) - target_link_libraries( ll::libxml INTERFACE libxml2_a) + target_link_libraries( ll::libxml INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libxml2.lib Bcrypt.lib) else() - target_link_libraries( ll::libxml INTERFACE xml2) + target_link_libraries( ll::libxml INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libxml2.a) endif() target_include_directories( ll::colladadom SYSTEM INTERFACE @@ -44,9 +41,9 @@ target_include_directories( ll::colladadom SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/collada/1.4 ) if (WINDOWS) - target_link_libraries(ll::colladadom INTERFACE libcollada14dom23-s ll::libxml ll::minizip-ng ) + target_link_libraries(ll::colladadom INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libcollada14dom23-s.lib ll::libxml ll::minizip-ng ) elseif (DARWIN) - target_link_libraries(ll::colladadom INTERFACE collada14dom ll::libxml ll::minizip-ng) + target_link_libraries(ll::colladadom INTERFACE collada14dom ll::boost ll::libxml ll::minizip-ng) elseif (LINUX) - target_link_libraries(ll::colladadom INTERFACE collada14dom ll::libxml ll::minizip-ng) + target_link_libraries(ll::colladadom INTERFACE collada14dom ll::boost ll::libxml ll::minizip-ng) endif() diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 0ab30d0800..1d757abeff 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -19,6 +19,7 @@ if (WINDOWS OR DARWIN ) endif() else() set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>) + set(SYMBOLS_STAGING_DIR ${CMAKE_BINARY_DIR}/symbols/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/${VIEWER_CHANNEL}) endif() if( DARWIN ) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index 6396a5bd01..7b2aa5971f 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -8,9 +8,7 @@ use_system_binary(nghttp2) use_prebuilt_binary(nghttp2) if (WINDOWS) target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) -elseif (DARWIN) - target_link_libraries( ll::nghttp2 INTERFACE libnghttp2.dylib) -else (WINDOWS) - target_link_libraries( ll::nghttp2 INTERFACE libnghttp2.a ) -endif (WINDOWS) +else () + target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libnghttp2.a) +endif () target_include_directories( ll::nghttp2 SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/nghttp2) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 0b6a7c2853..347dd02cd7 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -33,6 +33,9 @@ if (USE_OPENAL) alut ) else() - message(FATAL_ERROR "OpenAL is not available for this platform") + target_link_libraries( ll::openal INTERFACE + openal + alut + ) endif() endif () diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 3387c74f45..67a84e14af 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) include_guard() add_library( ll::openssl INTERFACE IMPORTED ) @@ -7,9 +8,9 @@ add_library( ll::openssl INTERFACE IMPORTED ) use_system_binary(openssl) use_prebuilt_binary(openssl) if (WINDOWS) - target_link_libraries(ll::openssl INTERFACE libssl libcrypto) + target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.lib ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.lib Crypt32.lib) elseif (LINUX) - target_link_libraries(ll::openssl INTERFACE ssl crypto dl) + target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.a ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.a dl) else() target_link_libraries(ll::openssl INTERFACE ssl crypto) endif (WINDOWS) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 044262bc8d..e5893e9a20 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -7,8 +7,8 @@ add_library( ll::libpng INTERFACE IMPORTED ) use_system_binary(libpng) use_prebuilt_binary(libpng) if (WINDOWS) - target_link_libraries(ll::libpng INTERFACE libpng16) + target_link_libraries(ll::libpng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libpng16.lib) else() - target_link_libraries(ll::libpng INTERFACE png16 ) + target_link_libraries(ll::libpng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libpng16.a) endif() target_include_directories( ll::libpng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/libpng16) diff --git a/indra/cmake/TinyEXR.cmake b/indra/cmake/TinyEXR.cmake index e6d142d19d..e741c07f6e 100644 --- a/indra/cmake/TinyEXR.cmake +++ b/indra/cmake/TinyEXR.cmake @@ -3,5 +3,5 @@ include(Prebuilt) use_prebuilt_binary(tinyexr) -set(TINYEXR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tinyexr) +set(TINYEXR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tinyexr) diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake deleted file mode 100644 index 6c33ff70e1..0000000000 --- a/indra/cmake/URIPARSER.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# -*- cmake -*- - -include_guard() - -include(Prebuilt) - -add_library( ll::uriparser INTERFACE IMPORTED ) - -use_system_binary( uriparser ) - -use_prebuilt_binary(uriparser) -if (WINDOWS) - target_link_libraries( ll::uriparser INTERFACE uriparser) -elseif (LINUX) - target_link_libraries( ll::uriparser INTERFACE uriparser) -elseif (DARWIN) - target_link_libraries( ll::uriparser INTERFACE liburiparser.dylib) -endif (WINDOWS) -target_include_directories( ll::uriparser SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/uriparser) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 59725ecc65..5b3aeb8b7f 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -5,7 +5,7 @@ # # Platform variables: # -# DARWIN - Mac OS X +# DARWIN - macOS # LINUX - Linux # WINDOWS - Windows diff --git a/indra/cmake/WebRTC.cmake b/indra/cmake/WebRTC.cmake new file mode 100644 index 0000000000..230522a40a --- /dev/null +++ b/indra/cmake/WebRTC.cmake @@ -0,0 +1,32 @@ +# -*- cmake -*- +include(Linking) +include(Prebuilt) + +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") +use_prebuilt_binary(webrtc) + +if (WINDOWS) + target_link_libraries( ll::webrtc INTERFACE webrtc.lib ) +elseif (DARWIN) + FIND_LIBRARY(COREAUDIO_LIBRARY CoreAudio) + FIND_LIBRARY(COREGRAPHICS_LIBRARY CoreGraphics) + FIND_LIBRARY(AUDIOTOOLBOX_LIBRARY AudioToolbox) + FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) + FIND_LIBRARY(COCOA_LIBRARY Cocoa) + + target_link_libraries( ll::webrtc INTERFACE + libwebrtc.a + ${COREAUDIO_LIBRARY} + ${AUDIOTOOLBOX_LIBRARY} + ${COREGRAPHICS_LIBRARY} + ${COREFOUNDATION_LIBRARY} + ${COCOA_LIBRARY} + ) +elseif (LINUX) + target_link_libraries( ll::webrtc INTERFACE libwebrtc.a X11 ) +endif (WINDOWS) + + diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake deleted file mode 100644 index 6409f9d6e2..0000000000 --- a/indra/cmake/XmlRpcEpi.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) - -include_guard() -add_library( ll::xmlrpc-epi INTERFACE IMPORTED ) - -use_system_binary( xmlrpc-epi ) - -use_prebuilt_binary(xmlrpc-epi) -target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) -target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index 5d99cd9709..d7b920da26 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -12,9 +12,9 @@ endif() use_prebuilt_binary(zlib-ng) if (WINDOWS) - target_link_libraries( ll::zlib-ng INTERFACE zlib ) + target_link_libraries( ll::zlib-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/zlib.lib ) else() - target_link_libraries( ll::zlib-ng INTERFACE z ) + target_link_libraries( ll::zlib-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libz.a ) endif (WINDOWS) if( NOT LINUX ) |