diff options
| -rw-r--r-- | indra/cmake/LLWindow.cmake | 2 | ||||
| -rw-r--r-- | indra/llwindow/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | indra/llwindow/llwindow.cpp | 30 | ||||
| -rw-r--r-- | indra/llxml/llxmlnode.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | indra/newview/llappviewer.cpp | 8 | 
6 files changed, 36 insertions, 30 deletions
| diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 089f1fffc2..1418518dc7 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -7,7 +7,7 @@ include(Prebuilt)  include_guard()  add_library( ll::SDL INTERFACE IMPORTED ) -if (USESYSTEMLIBS) +if (USESYSTEMLIBS AND NOT DARWIN)    include(FindPkgConfig)    pkg_check_modules(Sdl2 REQUIRED sdl2)    target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 1e3c517483..4d5c6053fb 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -64,7 +64,7 @@ include_directories(${CMAKE_SOURCE_DIR}/llrender)  # Libraries on which this library depends, needed for Linux builds  # Sort by high-level to low-level -if (USESYSTEMLIBS) +if (USESYSTEMLIBS AND NOT DARWIN)    list(APPEND viewer_SOURCE_FILES          llkeyboardsdl.cpp          llwindowsdl.cpp @@ -87,9 +87,9 @@ if (USESYSTEMLIBS)          )    endif (BUILD_HEADLESS) -endif (USESYSTEMLIBS) +endif (USESYSTEMLIBS AND NOT DARWIN) -if (DARWIN AND (NOT USESYSTEMLIBS)) +if (DARWIN)    list(APPEND llwindow_SOURCE_FILES      llkeyboardmacosx.cpp      llwindowmacosx.cpp @@ -111,7 +111,7 @@ if (DARWIN AND (NOT USESYSTEMLIBS))        PROPERTIES        COMPILE_FLAGS "-Wno-deprecated-declarations -fpascal-strings"        ) -endif (DARWIN AND (NOT USESYSTEMLIBS)) +endif (DARWIN)  if (WINDOWS) @@ -183,10 +183,10 @@ endif (SDL_FOUND)    target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES})    target_include_directories(llwindow INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -if (DARWIN AND (NOT USESYSTEMLIBS)) +if (DARWIN)    include(CMakeFindFrameworks)    find_library(CARBON_LIBRARY Carbon)    target_link_libraries(llwindow ${CARBON_LIBRARY}) -endif (DARWIN AND (NOT USESYSTEMLIBS)) +endif (DARWIN)  include(LibraryInstall) diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index b51b4fad82..6556bc09c6 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -33,10 +33,8 @@  #include "llwindowsdl.h"  #elif LL_WINDOWS  #include "llwindowwin32.h" -/*  #elif LL_DARWIN  #include "llwindowmacosx.h" -*/  #endif  #include "llerror.h" @@ -76,12 +74,12 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type)  #if LL_MESA_HEADLESS // !!! *FIX: (?)      LL_WARNS() << "OSMessageBox: " << text << LL_ENDL;      return OSBTN_OK; -#elif LL_SDL -    result = OSMessageBoxSDL(text, caption, type);  #elif LL_WINDOWS      result = OSMessageBoxWin32(text, caption, type); -#elif LL_DARWIN +#elif LL_DARWIN && !LL_SDL      result = OSMessageBoxMacOSX(text, caption, type); +#elif LL_SDL +    result = OSMessageBoxSDL(text, caption, type);  #else  #error("OSMessageBox not implemented for this platform!")  #endif @@ -261,12 +259,12 @@ BOOL LLWindow::copyTextToPrimary(const LLWString &src)  // static  std::vector<std::string> LLWindow::getDynamicFallbackFontList()  { -#if LL_SDL -    return LLWindowSDL::getDynamicFallbackFontList(); -#elif LL_WINDOWS +#if LL_WINDOWS      return LLWindowWin32::getDynamicFallbackFontList(); -#elif LL_DARWIN +#elif LL_DARWIN && !LL_SDL      return LLWindowMacOSX::getDynamicFallbackFontList(); +#elif LL_SDL +    return LLWindowSDL::getDynamicFallbackFontList();  #else      return std::vector<std::string>();  #endif @@ -275,12 +273,12 @@ std::vector<std::string> LLWindow::getDynamicFallbackFontList()  // static  std::vector<std::string> LLWindow::getDisplaysResolutionList()  { -#ifdef LL_SDL -    return std::vector<std::string>(); -#elif LL_WINDOWS +#if LL_WINDOWS      return LLWindowWin32::getDisplaysResolutionList(); -#elif LL_DARWIN +#elif LL_DARWIN && !LL_SDL      return LLWindowMacOSX::getDisplaysResolutionList(); +#else +    return std::vector<std::string>();  #endif  } @@ -348,7 +346,7 @@ LLSplashScreen *LLSplashScreen::create()      return 0;  #elif LL_WINDOWS      return new LLSplashScreenWin32; -#elif LL_DARWIN +#elif LL_DARWIN && !LL_SDL      return new LLSplashScreenMacOSX;  #else  #error("LLSplashScreen not implemented on this platform!") @@ -361,13 +359,11 @@ void LLSplashScreen::show()  {      if (!gSplashScreenp)      { -#if !LL_SDL  #if LL_WINDOWS && !LL_MESA_HEADLESS          gSplashScreenp = new LLSplashScreenWin32; -#elif LL_DARWIN +#elif LL_DARWIN && !LL_SDL          gSplashScreenp = new LLSplashScreenMacOSX;  #endif -#endif // !LL_SDL          if (gSplashScreenp)          {              gSplashScreenp->showImpl(); diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index df27f16ea1..d1c800dc7d 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -29,7 +29,9 @@  #include <iostream>  #include <map> +#if LL_SDL  #include <SDL_rwops.h> +#endif  #include "llxmlnode.h" diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 352dd4a5ee..2ea0ef19d3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1421,15 +1421,15 @@ set_source_files_properties(     )  if (DARWIN) -  if (NOT USESYSTEMLIBS) +#  if (NOT USESYSTEMLIBS)    LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp)    LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.mm)    LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.h) -  endif (NOT USESYSTEMLIBS) +#  endif (NOT USESYSTEMLIBS)    LIST(APPEND viewer_SOURCE_FILES llfilepicker_mac.mm)    LIST(APPEND viewer_HEADER_FILES llfilepicker_mac.h) -  if (NOT USESYSTEMLIBS) +#  if (NOT USESYSTEMLIBS)    # This should be compiled with the viewer.    LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm)    set_source_files_properties( @@ -1444,7 +1444,7 @@ if (DARWIN)      # warnings.      COMPILE_FLAGS "-fmodules -fcxx-modules -Wno-nullability-completeness"      ) -  endif (NOT USESYSTEMLIBS) +#  endif (NOT USESYSTEMLIBS)    # Add resource files to the project.    set(viewer_RESOURCE_FILES @@ -1464,7 +1464,7 @@ if (DARWIN)    list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES})  endif (DARWIN) -if (USESYSTEMLIBS) +if (USESYSTEMLIBS AND NOT DARWIN)      LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp)      set_source_files_properties(        llappviewerlinux.cpp @@ -1476,7 +1476,7 @@ if (USESYSTEMLIBS)      SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")      endif () -endif (USESYSTEMLIBS) +endif (USESYSTEMLIBS AND NOT DARWIN)  if (WINDOWS)      list(APPEND viewer_SOURCE_FILES diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 326ffa917a..601caddc7f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -138,7 +138,11 @@  #include "vlc/libvlc_version.h"  #if LL_DARWIN +#if LL_SDL  #include "llwindowsdl.h" +#else +#include "llwindowmacosx.h" +#endif // LL_SDL  #endif  // Third party library includes @@ -567,7 +571,11 @@ static void settings_to_globals()      LLWorldMapView::setScaleSetting(gSavedSettings.getF32("MapScale"));  #if LL_DARWIN +#if LL_SDL      LLWindowSDL::sUseMultGL = gSavedSettings.getBOOL("RenderAppleUseMultGL"); +#else +    LLWindowMacOSX::sUseMultGL = gSavedSettings.getBOOL("RenderAppleUseMultGL"); +#endif // LL_SDL      gHiDPISupport = gSavedSettings.getBOOL("RenderHiDPI");  #endif  } | 
