summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2025-08-27 23:05:40 -0400
committerRye <rye@alchemyviewer.org>2025-08-27 23:05:40 -0400
commit536c821c091be7020c614857e1fd220203f6ab23 (patch)
treecdf0bfd2d4c258624b643b4a95561dd3567f61ca /indra
parente629bf05d6212613083c8ccb2858085926f38902 (diff)
MacOS companion changes for dullahan 1.21 including package structure and linkage fixes
Diffstat (limited to 'indra')
-rw-r--r--indra/cmake/00-Common.cmake3
-rw-r--r--indra/cmake/CEFPlugin.cmake1
-rw-r--r--indra/cmake/PluginAPI.cmake4
-rw-r--r--indra/llfilesystem/lldir_mac.cpp2
-rw-r--r--indra/llplugin/CMakeLists.txt2
-rw-r--r--indra/llplugin/llpluginclassmedia.h7
-rw-r--r--indra/llplugin/slplugin/CMakeLists.txt28
-rw-r--r--indra/media_plugins/base/CMakeLists.txt2
-rw-r--r--indra/media_plugins/cef/CMakeLists.txt10
-rw-r--r--indra/media_plugins/example/CMakeLists.txt2
-rw-r--r--indra/media_plugins/libvlc/CMakeLists.txt2
-rw-r--r--indra/media_plugins/libvlc/media_plugin_libvlc.cpp2
-rw-r--r--indra/newview/CMakeLists.txt6
-rwxr-xr-xindra/newview/viewer_manifest.py123
14 files changed, 52 insertions, 142 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index c895f42362..5943e0b573 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -162,6 +162,9 @@ endif (LINUX)
if (DARWIN)
+ # Use rpath loading on macos
+ set(CMAKE_MACOSX_RPATH TRUE)
+
# Warnings should be fatal -- thanks, Nicky Perian, for spotting reversed default
set(CLANG_DISABLE_FATAL_WARNINGS OFF)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake
index 9b77becf29..e27929fa08 100644
--- a/indra/cmake/CEFPlugin.cmake
+++ b/indra/cmake/CEFPlugin.cmake
@@ -29,7 +29,6 @@ elseif (DARWIN)
${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a
${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a
${APPKIT_LIBRARY}
- "-F ${CEF_LIBRARY}"
)
elseif (LINUX)
diff --git a/indra/cmake/PluginAPI.cmake b/indra/cmake/PluginAPI.cmake
index 114415e514..a2bf13db2c 100644
--- a/indra/cmake/PluginAPI.cmake
+++ b/indra/cmake/PluginAPI.cmake
@@ -1,5 +1,7 @@
# -*- cmake -*-
+include(OpenGL)
+
add_library( ll::pluginlibraries INTERFACE IMPORTED )
if (WINDOWS)
@@ -13,4 +15,6 @@ if (WINDOWS)
)
endif (WINDOWS)
+target_link_libraries( ll::pluginlibraries INTERFACE OpenGL::GL)
+target_include_directories( ll::pluginlibraries INTERFACE ${CMAKE_SOURCE_DIR}/llimage ${CMAKE_SOURCE_DIR}/llrender)
diff --git a/indra/llfilesystem/lldir_mac.cpp b/indra/llfilesystem/lldir_mac.cpp
index b9be75c528..2db1b6ec5d 100644
--- a/indra/llfilesystem/lldir_mac.cpp
+++ b/indra/llfilesystem/lldir_mac.cpp
@@ -149,7 +149,7 @@ LLDir_Mac::LLDir_Mac()
mWorkingDir = getCurPath();
- mLLPluginDir = mAppRODataDir + mDirDelimiter + "llplugin";
+ mLLPluginDir = mAppRODataDir + mDirDelimiter + "SLPlugin.app" + mDirDelimiter + "Contents" + mDirDelimiter + "Frameworks";
}
}
diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt
index 14a69afe6e..f7f8c08adb 100644
--- a/indra/llplugin/CMakeLists.txt
+++ b/indra/llplugin/CMakeLists.txt
@@ -43,6 +43,6 @@ list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES})
add_library (llplugin ${llplugin_SOURCE_FILES})
target_include_directories( llplugin INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
-target_link_libraries( llplugin llcommon llmath llrender llmessage )
+target_link_libraries( llplugin llcommon llmath llmessage llxml )
add_subdirectory(slplugin)
diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h
index 292d934419..71522bcd7d 100644
--- a/indra/llplugin/llpluginclassmedia.h
+++ b/indra/llplugin/llpluginclassmedia.h
@@ -29,7 +29,6 @@
#ifndef LL_LLPLUGINCLASSMEDIA_H
#define LL_LLPLUGINCLASSMEDIA_H
-#include "llgltypes.h"
#include "llpluginprocessparent.h"
#include "llrect.h"
#include "llpluginclassmediaowner.h"
@@ -365,9 +364,9 @@ protected:
bool mTextureParamsReceived; // the mRequestedTexture* fields are only valid when this is true
S32 mRequestedTextureDepth;
- LLGLenum mRequestedTextureInternalFormat;
- LLGLenum mRequestedTextureFormat;
- LLGLenum mRequestedTextureType;
+ U32 mRequestedTextureInternalFormat;
+ U32 mRequestedTextureFormat;
+ U32 mRequestedTextureType;
bool mRequestedTextureSwapBytes;
bool mRequestedTextureCoordsOpenGL;
diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt
index 0ea6495eac..e639e522af 100644
--- a/indra/llplugin/slplugin/CMakeLists.txt
+++ b/indra/llplugin/slplugin/CMakeLists.txt
@@ -30,18 +30,6 @@ add_executable(SLPlugin
${SLPlugin_SOURCE_FILES}
)
-if (WINDOWS)
-set_target_properties(SLPlugin
- PROPERTIES
- LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\""
- )
-else ()
-set_target_properties(SLPlugin
- PROPERTIES
- MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist
- )
-endif ()
-
target_link_libraries(SLPlugin
llplugin
llmessage
@@ -49,7 +37,19 @@ target_link_libraries(SLPlugin
ll::pluginlibraries
)
-if (DARWIN)
+if (WINDOWS)
+ set_target_properties(SLPlugin
+ PROPERTIES
+ LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\""
+ )
+elseif (DARWIN)
+ set_target_properties(SLPlugin
+ PROPERTIES
+ BUILD_WITH_INSTALL_RPATH 1
+ INSTALL_RPATH "@executable_path/../../../../Frameworks;@executable_path/../Frameworks;@executable_path/../Frameworks/plugins"
+ MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist
+ )
+
# Make sure the app bundle has a Resources directory (it will get populated by viewer-manifest.py later)
add_custom_command(
TARGET SLPlugin POST_BUILD
@@ -58,7 +58,7 @@ if (DARWIN)
-p
${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/SLPlugin.app/Contents/Resources
)
-endif (DARWIN)
+endif ()
if (LL_TESTS)
ll_deploy_sharedlibs_command(SLPlugin)
diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt
index 64b6a4228d..23f503c345 100644
--- a/indra/media_plugins/base/CMakeLists.txt
+++ b/indra/media_plugins/base/CMakeLists.txt
@@ -34,5 +34,5 @@ add_library(media_plugin_base
${media_plugin_base_SOURCE_FILES}
)
-target_link_libraries( media_plugin_base llplugin )
+target_link_libraries( media_plugin_base llplugin ll::pluginlibraries)
target_include_directories( media_plugin_base INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt
index 0d1a833936..ebcf67576d 100644
--- a/indra/media_plugins/cef/CMakeLists.txt
+++ b/indra/media_plugins/cef/CMakeLists.txt
@@ -77,16 +77,8 @@ if (DARWIN)
PROPERTIES
PREFIX ""
BUILD_WITH_INSTALL_RPATH 1
- INSTALL_NAME_DIR "@executable_path"
+ INSTALL_RPATH "@executable_path/../Frameworks"
LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
)
- add_custom_command(TARGET media_plugin_cef
- POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "@executable_path/Chromium Embedded Framework"
- "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework"
- "$<TARGET_FILE:media_plugin_cef>"
- VERBATIM
- COMMENT "Fixing path to CEF Framework"
- )
-
endif (DARWIN)
diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt
index 41e2353f31..278dac8c33 100644
--- a/indra/media_plugins/example/CMakeLists.txt
+++ b/indra/media_plugins/example/CMakeLists.txt
@@ -47,7 +47,7 @@ if (DARWIN)
PROPERTIES
PREFIX ""
BUILD_WITH_INSTALL_RPATH 1
- INSTALL_NAME_DIR "@executable_path"
+ INSTALL_RPATH "@executable_path/../Frameworks"
LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
)
diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt
index 202cbed96e..f9e0810df2 100644
--- a/indra/media_plugins/libvlc/CMakeLists.txt
+++ b/indra/media_plugins/libvlc/CMakeLists.txt
@@ -50,7 +50,7 @@ if (DARWIN)
PROPERTIES
PREFIX ""
BUILD_WITH_INSTALL_RPATH 1
- INSTALL_NAME_DIR "@executable_path"
+ INSTALL_RPATH "@executable_path/../Frameworks"
LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
)
diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
index 4240613a0c..ad0ecaf4ab 100644
--- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
+++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
@@ -174,7 +174,7 @@ void MediaPluginLibVLC::initVLC()
};
#if LL_DARWIN
- setenv("VLC_PLUGIN_PATH", ".", 1);
+ setenv("VLC_PLUGIN_PATH", "./plugins", 1);
#endif
int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv);
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index f2aec208a1..40b6b35704 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2156,10 +2156,8 @@ if (DARWIN)
PROPERTIES
OUTPUT_NAME "${product}"
# From Contents/MacOS/SecondLife, look in Contents/Frameworks
- INSTALL_RPATH "@loader_path/../Frameworks"
- # SIGH, as of 2018-05-24 (cmake 3.11.1) the INSTALL_RPATH property simply
- # does not work. Try this:
- LINK_FLAGS "-rpath @loader_path/../Frameworks"
+ BUILD_WITH_INSTALL_RPATH 1
+ INSTALL_RPATH "@executable_path/../Frameworks"
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}"
)
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 1146922d5d..666f7675ac 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -865,9 +865,6 @@ class Darwin_x86_64_Manifest(ViewerManifest):
# CEF framework goes inside Contents/Frameworks.
# Remember where we parked this car.
with self.prefix(src="", dst="Frameworks"):
- CEF_framework = "Chromium Embedded Framework.framework"
- self.path2basename(relpkgdir, CEF_framework)
- CEF_framework = self.dst_path_of(CEF_framework)
if self.args.get('bugsplat'):
self.path2basename(relpkgdir, "BugsplatMac.framework")
@@ -1065,113 +1062,31 @@ class Darwin_x86_64_Manifest(ViewerManifest):
# Dullahan helper apps go inside SLPlugin.app
with self.prefix(dst=os.path.join(
"SLPlugin.app", "Contents", "Frameworks")):
-
- frameworkname = 'Chromium Embedded Framework'
-
- # This code constructs a relative symlink from the
- # target framework folder back to the real CEF framework.
- # It needs to be relative so that the symlink still works when
- # (as is normal) the user moves the app bundle out of the DMG
- # and into the /Applications folder. Note we pass catch=False,
- # letting the uncaught exception terminate the process, since
- # without this symlink, Second Life web media can't possibly work.
-
- # It might seem simpler just to symlink Frameworks back to
- # the parent of Chromimum Embedded Framework.framework. But
- # that would create a symlink cycle, which breaks our
- # packaging step. So make a symlink from Chromium Embedded
- # Framework.framework to the directory of the same name, which
- # is NOT an ancestor of the symlink.
-
- # from SLPlugin.app/Contents/Frameworks/Chromium Embedded
- # Framework.framework back to
- # $viewer_app/Contents/Frameworks/Chromium Embedded Framework.framework
- SLPlugin_framework = self.relsymlinkf(CEF_framework, catch=False)
-
- # for all the multiple CEF/Dullahan (as of CEF 76) helper app bundles we need:
- for helper in (
- "DullahanHelper",
- "DullahanHelper (GPU)",
- "DullahanHelper (Renderer)",
- "DullahanHelper (Plugin)",
- ):
- # app is the directory name of the app bundle, with app/Contents/MacOS/helper as the executable
- app = helper + ".app"
-
- # copy DullahanHelper.app
- self.path2basename(relpkgdir, app)
-
- # and fix that up with a Frameworks/CEF symlink too
- with self.prefix(dst=os.path.join(
- app, 'Contents', 'Frameworks')):
- # from Dullahan Helper *.app/Contents/Frameworks/Chromium Embedded
- # Framework.framework back to
- # SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework
- # Since SLPlugin_framework is itself a
- # symlink, don't let relsymlinkf() resolve --
- # explicitly call relpath(symlink=True) and
- # create that symlink here.
- helper_framework = \
- self.symlinkf(self.relpath(SLPlugin_framework, symlink=True), catch=False)
-
- # change_command includes install_name_tool, the
- # -change subcommand and the old framework rpath
- # stamped into the executable. To use it with
- # run_command(), we must still append the new
- # framework path and the pathname of the
- # executable to change.
- change_command = [
- 'install_name_tool', '-change',
- '@rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework']
-
- with self.prefix(dst=os.path.join(
- app, 'Contents', 'MacOS')):
- # Now self.get_dst_prefix() is, at runtime,
- # @executable_path. Locate the helper app
- # framework (which is a symlink) from here.
- newpath = os.path.join(
- '@executable_path',
- self.relpath(helper_framework, symlink=True),
- frameworkname)
- # and restamp the Dullahan Helper executable itself
- self.run_command(
- change_command +
- [newpath, self.dst_path_of(helper)])
-
- # SLPlugin plugins
- with self.prefix(dst="llplugin"):
- dylibexecutable = 'media_plugin_cef.dylib'
+ # copy CEF plugin
self.path2basename("../media_plugins/cef/" + self.args['configuration'],
- dylibexecutable)
-
- # Do this install_name_tool *after* media plugin is copied over.
- # Locate the framework lib executable -- relative to
- # SLPlugin.app/Contents/MacOS, which will be our
- # @executable_path at runtime!
- newpath = os.path.join(
- '@executable_path',
- self.relpath(SLPlugin_framework, executable_path["SLPlugin.app"],
- symlink=True),
- frameworkname)
- # restamp media_plugin_cef.dylib
- self.run_command(
- change_command +
- [newpath, self.dst_path_of(dylibexecutable)])
-
- # copy LibVLC plugin itself
- dylibexecutable = 'media_plugin_libvlc.dylib'
- self.path2basename("../media_plugins/libvlc/" + self.args['configuration'], dylibexecutable)
- # add @rpath for the correct LibVLC subfolder
- self.run_command(['install_name_tool', '-add_rpath', '@loader_path/lib', self.dst_path_of(dylibexecutable)])
-
- # copy LibVLC dynamic libraries
- with self.prefix(src=relpkgdir, dst="lib"):
+ "media_plugin_cef.dylib")
+
+ # copy LibVLC plugin
+ self.path2basename("../media_plugins/libvlc/" + self.args['configuration'],
+ "media_plugin_libvlc.dylib")
+
+ # CEF framework and vlc libraries goes inside Contents/Frameworks.
+ with self.prefix(src=os.path.join(pkgdir, 'lib', 'release')):
+ self.path("Chromium Embedded Framework.framework")
+ self.path("DullahanHelper.app")
+ self.path("DullahanHelper (Alerts).app")
+ self.path("DullahanHelper (GPU).app")
+ self.path("DullahanHelper (Renderer).app")
+ self.path("DullahanHelper (Plugin).app")
+
+ # Copy libvlc
self.path( "libvlc*.dylib*" )
# copy LibVLC plugins folder
- with self.prefix(src='plugins', dst=""):
+ with self.prefix(src='plugins', dst="plugins"):
self.path( "*.dylib" )
self.path( "plugins.dat" )
+
def package_finish(self):
imagename = self.installer_base_name()
self.set_github_output('imagename', imagename)