Skip to content

Commit

Permalink
Fix build on windows due to deprecation and linking issues and linux …
Browse files Browse the repository at this point in the history
…due to warnings after macos changes
  • Loading branch information
RyeMutt committed Dec 13, 2024
1 parent f05c685 commit 6369e0e
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 34 deletions.
3 changes: 2 additions & 1 deletion indra/cmake/00-Common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ if (WINDOWS)
NOMINMAX
# DOM_DYNAMIC # For shared library colladadom
_CRT_SECURE_NO_WARNINGS # Allow use of sprintf etc
_CRT_NONSTDC_NO_DEPRECATE # Allow use of sprintf etc
_WINSOCK_DEPRECATED_NO_WARNINGS # Disable deprecated WinSock API warnings
)
add_compile_options(
Expand Down Expand Up @@ -222,7 +223,7 @@ if(LINUX OR DARWIN)
endif()

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wno-stringop-truncation -Wno-parentheses)
add_compile_options(-Wno-stringop-truncation -Wno-parentheses -Wno-maybe-uninitialized)
endif()

if (NOT GCC_DISABLE_FATAL_WARNINGS AND NOT CLANG_DISABLE_FATAL_WARNINGS)
Expand Down
2 changes: 1 addition & 1 deletion indra/cmake/Audio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (WINDOWS)
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib
)
else (WINDOWS)
target_link_libraries(ll::vorbis INTERFACE
target_link_libraries(ll::vorbis INTERFACE
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.a
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.a
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.a
Expand Down
16 changes: 8 additions & 8 deletions indra/cmake/Boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ set(addrsfx "-x${ADDRESS_SIZE}")

if (WINDOWS)
target_link_libraries( ll::boost INTERFACE
libboost_context-mt${addrsfx}
libboost_fiber-mt${addrsfx}
libboost_filesystem-mt${addrsfx}
libboost_program_options-mt${addrsfx}
libboost_regex-mt${addrsfx}
libboost_system-mt${addrsfx}
libboost_thread-mt${addrsfx}
libboost_url-mt${addrsfx}
${ARCH_PREBUILT_DIRS_RELEASE}/libboost_context-mt${addrsfx}.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libboost_fiber-mt${addrsfx}.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libboost_filesystem-mt${addrsfx}.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libboost_program_options-mt${addrsfx}.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libboost_regex-mt${addrsfx}.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libboost_system-mt${addrsfx}.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libboost_thread-mt${addrsfx}.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libboost_url-mt${addrsfx}.lib
)
elseif (DARWIN)
target_link_libraries( ll::boost INTERFACE
Expand Down
12 changes: 6 additions & 6 deletions indra/cmake/CEFPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ target_include_directories( ll::cef SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/inclu

if (WINDOWS)
target_link_libraries( ll::cef INTERFACE
libcef.lib
libcef_dll_wrapper.lib
dullahan.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libcef.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.lib
${ARCH_PREBUILT_DIRS_RELEASE}/dullahan.lib
)
elseif (DARWIN)
FIND_LIBRARY(APPKIT_LIBRARY AppKit)
Expand All @@ -34,8 +34,8 @@ elseif (DARWIN)

elseif (LINUX)
target_link_libraries( ll::cef INTERFACE
libdullahan.a
cef
cef_dll_wrapper.a
${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a
${ARCH_PREBUILT_DIRS_RELEASE}/libcef.so
${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a
)
endif (WINDOWS)
8 changes: 4 additions & 4 deletions indra/cmake/LibVLCPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ set(LIBVLCPLUGIN ON CACHE BOOL

if (WINDOWS)
target_link_libraries( ll::libvlc INTERFACE
libvlc.lib
libvlccore.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libvlc.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libvlccore.lib
)
elseif (DARWIN)
target_link_libraries( ll::libvlc INTERFACE
${ARCH_PREBUILT_DIRS_RELEASE}/libvlc.dylib
${ARCH_PREBUILT_DIRS_RELEASE}/libvlccore.dylib
${ARCH_PREBUILT_DIRS_RELEASE}/libvlc.dylib
${ARCH_PREBUILT_DIRS_RELEASE}/libvlccore.dylib
)
endif (WINDOWS)
2 changes: 1 addition & 1 deletion indra/cmake/NVAPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(NVAPI ON CACHE BOOL "Use NVAPI.")
if (NVAPI)
if (WINDOWS)
add_library( ll::nvapi INTERFACE IMPORTED )
target_link_libraries( ll::nvapi INTERFACE nvapi)
target_link_libraries( ll::nvapi INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nvapi.lib)
use_prebuilt_binary(nvapi)
endif (WINDOWS)
endif (NVAPI)
Expand Down
8 changes: 4 additions & 4 deletions indra/cmake/OPENAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ if (USE_OPENAL)

if(WINDOWS)
target_link_libraries( ll::openal INTERFACE
OpenAL32
alut
${ARCH_PREBUILT_DIRS_RELEASE}/OpenAL32.lib
${ARCH_PREBUILT_DIRS_RELEASE}/alut.lib
)
elseif(LINUX)
target_link_libraries( ll::openal INTERFACE
openal
alut
${ARCH_PREBUILT_DIRS_RELEASE}/libopenal.so
${ARCH_PREBUILT_DIRS_RELEASE}/libalut.so
)
else()
target_link_libraries( ll::openal INTERFACE
Expand Down
8 changes: 4 additions & 4 deletions indra/cmake/OpenJPEG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ add_library( ll::openjpeg INTERFACE IMPORTED )
use_system_binary(openjpeg)
use_prebuilt_binary(openjpeg)

if(DARWIN)
target_link_libraries(ll::openjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libopenjp2.a )
if(WINDOWS)
target_link_libraries(ll::openjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/openjp2.lib)
else()
target_link_libraries(ll::openjpeg INTERFACE openjp2 )
target_link_libraries(ll::openjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libopenjp2.a)
endif()
target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg)
target_include_directories(ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg)
5 changes: 5 additions & 0 deletions indra/llcommon/llsys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ LLOSInfo::LLOSInfo() :
GetSystemInfo(&si); //if it fails get regular system info
//(Warning: If GetSystemInfo it may result in incorrect information in a WOW64 machine, if the kernel fails to load)

#pragma warning(push)
#pragma warning(disable : 4996) // ignore 'deprecated.' GetVersionEx is deprecated

// Try calling GetVersionEx using the OSVERSIONINFOEX structure.
OSVERSIONINFOEX osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
Expand All @@ -210,6 +213,8 @@ LLOSInfo::LLOSInfo() :
}
}

#pragma warning(pop)

S32 ubr = 0; // Windows 10 Update Build Revision, can be retrieved from a registry
if (mMajorVer == 10)
{
Expand Down
11 changes: 11 additions & 0 deletions indra/llmath/llcalcparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
#ifndef LL_CALCPARSER_H
#define LL_CALCPARSER_H

#include "llpreprocessor.h"

#if defined(LL_GNUC) && GCC_VERSION >= 130000
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdangling-pointer"
#endif

#include <boost/spirit/include/classic_attribute.hpp>
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_error_handling.hpp>
Expand All @@ -35,6 +42,10 @@
#include <boost/spirit/include/classic_symbols.hpp>
using namespace boost::spirit::classic;

#if defined(LL_GNUC) && GCC_VERSION >= 130000
# pragma GCC diagnostic pop
#endif

#include "llcalc.h"
#include "llmath.h"

Expand Down
5 changes: 3 additions & 2 deletions indra/newview/llface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1450,8 +1450,8 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
}

const LLMeshSkinInfo* skin = nullptr;
LLMatrix4a mat_vert;
LLMatrix4a mat_normal;
LLMatrix4a mat_vert = LLMatrix4a::identity();
LLMatrix4a mat_normal = LLMatrix4a::identity();

// prepare mat_vert
if (rebuild_pos)
Expand Down Expand Up @@ -1921,6 +1921,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,


LLVector4a res0; //,res1,res2,res3;
res0.clear();

LLVector4a texIdx;

Expand Down
4 changes: 2 additions & 2 deletions indra/newview/llinventorygallerymenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,11 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata)
}
else if ("copy_slurl" == action)
{
boost::function<void(LLLandmark*)> copy_slurl_cb = [](LLLandmark* landmark)
auto copy_slurl_cb = [](LLLandmark* landmark)
{
LLVector3d global_pos;
landmark->getGlobalPos(global_pos);
boost::function<void(std::string& slurl)> copy_slurl_to_clipboard_cb = [](const std::string& slurl)
auto copy_slurl_to_clipboard_cb = [](const std::string& slurl)
{
gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(slurl));
LLSD args;
Expand Down
2 changes: 1 addition & 1 deletion indra/newview/llvoicevivox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ bool LLVivoxVoiceClient::breakVoiceConnection(bool corowait)
// At this point message system is already down so we can't wait for
// the message, yet we need to receive "connector shutdown response".
// Either wait a bit and emulate it or check gMessageSystem for specific message
_sleep(1000);
Sleep(1000);
if (sConnected)
{
sConnected = false;
Expand Down
9 changes: 9 additions & 0 deletions indra/newview/llxmlrpclistener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,11 @@ class Poller
LLXMLRPCTransaction::EStatus mPreviousStatus; // To detect state changes.
};

#if defined(LL_GNUC)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wuninitialized"
#endif

LLXMLRPCListener::LLXMLRPCListener(const std::string& pumpname)
: mBoundListener(LLEventPumps::instance().obtain(pumpname).listen
(
Expand All @@ -364,3 +369,7 @@ LLXMLRPCListener::LLXMLRPCListener(const std::string& pumpname)
))
{
}

#if defined(LL_GNUC)
# pragma GCC diagnostic pop
#endif

0 comments on commit 6369e0e

Please sign in to comment.