From eb6edf6255e50bf908a74c230f67c24568067ef9 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Wed, 22 Jul 2020 12:09:48 +0000
Subject: [PATCH] Revert "Cleanup legacy compat hack fro old ucrt"

This reverts commit f8ccb750ffeaf4cd1bb1d4514741e2c5a407392f
---
 indra/CMakeLists.txt                   | 5 +++++
 indra/cmake/LLAddBuildTest.cmake       | 1 +
 indra/llcorehttp/CMakeLists.txt        | 1 +
 indra/llplugin/slplugin/CMakeLists.txt | 1 +
 indra/newview/CMakeLists.txt           | 1 +
 indra/test/CMakeLists.txt              | 1 +
 indra/win_crash_logger/CMakeLists.txt  | 1 +
 7 files changed, 11 insertions(+)

diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt
index 065eefc8749..301ff27e050 100644
--- a/indra/CMakeLists.txt
+++ b/indra/CMakeLists.txt
@@ -20,6 +20,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 include(Variables)
 include(BuildVersion)
 
+set(LEGACY_STDIO_LIBS)
+if (WINDOWS)
+      set(LEGACY_STDIO_LIBS legacy_stdio_definitions)
+endif (WINDOWS)
+
 if (NOT CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
       "Build type.  One of: Debug Release RelWithDebInfo" FORCE)
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index ee6396e473c..4932e9044f3 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -200,6 +200,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
     )
 
   SET(libraries
+    ${LEGACY_STDIO_LIBS}
     ${library_dependencies}
     ${BOOST_FIBER_LIBRARY}
     ${BOOST_CONTEXT_LIBRARY}
diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt
index 32961d78d4b..ee1163f1130 100644
--- a/indra/llcorehttp/CMakeLists.txt
+++ b/indra/llcorehttp/CMakeLists.txt
@@ -201,6 +201,7 @@ endif (DARWIN)
       )
 
   set(example_libs
+      ${LEGACY_STDIO_LIBS}
       ${LLCOREHTTP_LIBRARIES}
       ${WINDOWS_LIBRARIES}
       ${LLMESSAGE_LIBRARIES}
diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt
index 33520ad64c2..e4f64448c55 100644
--- a/indra/llplugin/slplugin/CMakeLists.txt
+++ b/indra/llplugin/slplugin/CMakeLists.txt
@@ -63,6 +63,7 @@ set_target_properties(SLPlugin
 endif ()
 
 target_link_libraries(SLPlugin
+  ${LEGACY_STDIO_LIBS}
   ${LLPLUGIN_LIBRARIES}
   ${LLMESSAGE_LIBRARIES}
   ${LLCOMMON_LIBRARIES}
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 255c1de44de..33a18dea087 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2055,6 +2055,7 @@ endif (WINDOWS)
 # modern version.
 
 target_link_libraries(${VIEWER_BINARY_NAME}
+    ${LEGACY_STDIO_LIBS}
     ${PNG_PRELOAD_ARCHIVES}
     ${ZLIB_PRELOAD_ARCHIVES}
     ${URIPARSER_PRELOAD_ARCHIVES}
diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt
index b443da43ac4..87536e146ba 100644
--- a/indra/test/CMakeLists.txt
+++ b/indra/test/CMakeLists.txt
@@ -84,6 +84,7 @@ list(APPEND test_SOURCE_FILES ${test_HEADER_FILES})
 add_executable(lltest ${test_SOURCE_FILES})
 
 target_link_libraries(lltest
+    ${LEGACY_STDIO_LIBS}
     ${LLDATABASE_LIBRARIES}
     ${LLINVENTORY_LIBRARIES}
     ${LLMESSAGE_LIBRARIES}
diff --git a/indra/win_crash_logger/CMakeLists.txt b/indra/win_crash_logger/CMakeLists.txt
index 3551b7c1369..4440f488a2e 100644
--- a/indra/win_crash_logger/CMakeLists.txt
+++ b/indra/win_crash_logger/CMakeLists.txt
@@ -72,6 +72,7 @@ add_executable(windows-crash-logger WIN32 ${win_crash_logger_SOURCE_FILES})
 
 
 target_link_libraries(windows-crash-logger
+    ${LEGACY_STDIO_LIBS}
     ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES}
     ${LLCRASHLOGGER_LIBRARIES}
     ${LLWINDOW_LIBRARIES}
-- 
GitLab