diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-05-27 02:53:34 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-05-27 02:53:34 +0300 |
commit | b2ef95522f07301cfddbdace1042e60d52fde436 (patch) | |
tree | c51119f79b734a7d503bb3adeac1759b819c8f92 /indra/cmake | |
parent | 43a338c6270f9a000052465d09d4ad999524af0b (diff) | |
parent | 3da7a50b71d4ef5919c2d4d5b9547b3ef0abab7d (diff) |
Merge branch 'DRTVWR-543-maint' into DRTVWR-543-maint_cmake
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/00-Common.cmake | 15 | ||||
-rw-r--r-- | indra/cmake/CMakeLists.txt | 3 | ||||
-rw-r--r-- | indra/cmake/Copy3rdPartyLibs.cmake | 6 | ||||
-rw-r--r-- | indra/cmake/GLOD.cmake | 11 | ||||
-rw-r--r-- | indra/cmake/LLCommon.cmake | 5 | ||||
-rw-r--r-- | indra/cmake/LLMeshOptimizer.cmake | 7 | ||||
-rw-r--r-- | indra/cmake/MESHOPTIMIZER.cmake | 16 | ||||
-rw-r--r-- | indra/cmake/Tracy.cmake | 29 |
8 files changed, 71 insertions, 21 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 0ab7fa2456..572422d080 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -42,8 +42,8 @@ if(NON_RELEASE_CRASH_REPORTING) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1") endif() -# Don't bother with a MinSizeRel build. -set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING +# Don't bother with MinSizeRel or Debug builds. +set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release" CACHE STRING "Supported build types." FORCE) @@ -66,16 +66,21 @@ if (WINDOWS) # CP changed to only append the flag for 32bit builds - on 64bit builds, # locally at least, the build output is spammed with 1000s of 'D9002' # warnings about this switch being ignored. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") if( ADDRESS_SIZE EQUAL 32 ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /p:PreferredToolArchitecture=x64") endif() + # Preserve first-pass-through versions (ie no FORCE overwrite). Prevents recursive addition of /Zo (04/2021) + set(OG_CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} CACHE STRING "OG_CXX_FLAGS_RELEASE") + set(OG_CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} CACHE STRING "OG_CXX_FLAGS_RELWITHDEBINFO") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo" + "${OG_CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo" CACHE STRING "C++ compiler release-with-debug options" FORCE) set(CMAKE_CXX_FLAGS_RELEASE - "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /Zo" + "${OG_CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /Zo" CACHE STRING "C++ compiler release options" FORCE) + # zlib has assembly-language object files incompatible with SAFESEH set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099") diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 6778e90ca8..4d70089737 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -38,7 +38,6 @@ set(cmake_SOURCE_FILES FreeType.cmake GLEXT.cmake GLH.cmake - GLOD.cmake ## GStreamer010Plugin.cmake GoogleMock.cmake Havok.cmake @@ -57,6 +56,7 @@ set(cmake_SOURCE_FILES LLKDU.cmake LLLogin.cmake LLMath.cmake + LLMeshOptimizer.cmake LLMessage.cmake LLPhysicsExtensions.cmake LLPlugin.cmake @@ -70,6 +70,7 @@ set(cmake_SOURCE_FILES LLXML.cmake Linking.cmake MediaPluginBase.cmake + MESHOPTIMIZER.cmake NDOF.cmake OPENAL.cmake OpenGL.cmake diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index b20d23cead..ff705101de 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -57,7 +57,6 @@ if(WINDOWS) libaprutil-1.dll libapriconv-1.dll nghttp2.dll - glod.dll libhunspell.dll uriparser.dll ) @@ -104,6 +103,8 @@ if(WINDOWS) set(MSVC_VER 120) elseif (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920) # Visual Studio 2017 set(MSVC_VER 140) + elseif (MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930) # Visual Studio 2019 + set(MSVC_VER 140) else (MSVC80) MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake") endif (MSVC80) @@ -128,6 +129,7 @@ if(WINDOWS) msvcp${MSVC_VER}.dll msvcr${MSVC_VER}.dll vcruntime${MSVC_VER}.dll + vcruntime${MSVC_VER}_1.dll ) if(EXISTS "${registry_path}/${release_msvc_file}") to_staging_dirs( @@ -166,7 +168,6 @@ elseif(DARWIN) libaprutil-1.0.dylib libaprutil-1.dylib ${EXPAT_COPY} - libGLOD.dylib libhunspell-1.3.0.dylib libndofdev.dylib libnghttp2.dylib @@ -215,7 +216,6 @@ elseif(LINUX) ${EXPAT_COPY} libfreetype.so.6.6.2 libfreetype.so.6 - libGLOD.so libgmodule-2.0.so libgobject-2.0.so libhunspell-1.3.so.0.0.0 diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake deleted file mode 100644 index 6f42b44ab8..0000000000 --- a/indra/cmake/GLOD.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) - -if (NOT USESYSTEMLIBS) - use_prebuilt_binary(glod) -endif (NOT USESYSTEMLIBS) - -set(GLODLIB ON CACHE BOOL "Using GLOD library") - -set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) -set(GLOD_LIBRARIES GLOD) diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake index 9c8740793a..53871791fd 100644 --- a/indra/cmake/LLCommon.cmake +++ b/indra/cmake/LLCommon.cmake @@ -3,12 +3,14 @@ include(APR) include(Boost) include(EXPAT) +include(Tracy) include(ZLIBNG) set(LLCOMMON_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llcommon ${APRUTIL_INCLUDE_DIR} ${APR_INCLUDE_DIR} + ${TRACY_INCLUDE_DIR} ) set(LLCOMMON_SYSTEM_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} @@ -30,7 +32,8 @@ else (LINUX) ${BOOST_FIBER_LIBRARY} ${BOOST_CONTEXT_LIBRARY} ${BOOST_THREAD_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} ) + ${BOOST_SYSTEM_LIBRARY} + ) endif (LINUX) set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a static library.") diff --git a/indra/cmake/LLMeshOptimizer.cmake b/indra/cmake/LLMeshOptimizer.cmake new file mode 100644 index 0000000000..b79944f618 --- /dev/null +++ b/indra/cmake/LLMeshOptimizer.cmake @@ -0,0 +1,7 @@ +# -*- cmake -*- + +set(LLMESHOPTIMIZER_INCLUDE_DIRS + ${LIBS_OPEN_DIR}/llmeshoptimizer + ) + +set(LLMESHOPTIMIZER_LIBRARIES llmeshoptimizer) diff --git a/indra/cmake/MESHOPTIMIZER.cmake b/indra/cmake/MESHOPTIMIZER.cmake new file mode 100644 index 0000000000..1c5b47b9bd --- /dev/null +++ b/indra/cmake/MESHOPTIMIZER.cmake @@ -0,0 +1,16 @@ +# -*- cmake -*- + +include(Linking) +include(Prebuilt) + +use_prebuilt_binary(meshoptimizer) + +if (WINDOWS) + set(MESHOPTIMIZER_LIBRARIES meshoptimizer.lib) +elseif (LINUX) + set(MESHOPTIMIZER_LIBRARIES meshoptimizer.o) +elseif (DARWIN) + set(MESHOPTIMIZER_LIBRARIES libmeshoptimizer.a) +endif (WINDOWS) + +set(MESHOPTIMIZER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/meshoptimizer) diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake new file mode 100644 index 0000000000..cfff956bcf --- /dev/null +++ b/indra/cmake/Tracy.cmake @@ -0,0 +1,29 @@ +# -*- cmake -*- +include(Prebuilt) + +set(USE_TRACY OFF CACHE BOOL "Use Tracy profiler.") + +if (USE_TRACY) + set(TRACY_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tracy) + +# See: indra/llcommon/llprofiler.h + add_definitions(-DLL_PROFILER_CONFIGURATION=3) + use_prebuilt_binary(tracy) + + if (WINDOWS) + MESSAGE(STATUS "Including Tracy for Windows: '${TRACY_INCLUDE_DIR}'") + endif (WINDOWS) + + if (DARWIN) + MESSAGE(STATUS "Including Tracy for Darwin: '${TRACY_INCLUDE_DIR}'") + endif (DARWIN) + + if (LINUX) + MESSAGE(STATUS "Including Tracy for Linux: '${TRACY_INCLUDE_DIR}'") + endif (LINUX) +else (USE_TRACY) + # Tracy.cmake should not set LLCOMMON_INCLUDE_DIRS, let LLCommon.cmake do that + set(TRACY_INCLUDE_DIR "") + set(TRACY_LIBRARY "") +endif (USE_TRACY) + |