OS X build fixes

This commit is contained in:
Siana Gearz
2011-07-03 14:08:50 +02:00
parent af9259e626
commit 73fd876423
10 changed files with 58 additions and 38 deletions

View File

@@ -88,7 +88,7 @@ if (VIEWER)
add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
add_dependencies(viewer linux-crash-logger-strip-target)
elseif (DARWIN)
add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
#add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
#add_subdirectory(${VIEWER_PREFIX}mac_updater)
add_dependencies(viewer mac-crash-logger)
#add_dependencies(viewer mac-updater)

View File

@@ -5,6 +5,12 @@ include(Boost)
include(EXPAT)
include(ZLIB)
if (DARWIN)
include(CMakeFindFrameworks)
find_library(CORESERVICES_LIBRARY CoreServices)
endif (DARWIN)
set(LLCOMMON_INCLUDE_DIRS
${LIBS_OPEN_DIR}/cwdebug
${LIBS_OPEN_DIR}/llcommon

View File

@@ -223,6 +223,7 @@ target_link_libraries(
${ZLIB_LIBRARIES}
${WINDOWS_LIBRARIES}
${CWDEBUG_LIBRARIES}
${CORESERVICES_LIBRARY}
)
if (LINUX)

View File

@@ -52,7 +52,7 @@
# include <sys/sysctl.h>
# include <sys/utsname.h>
# include <stdint.h>
//# include <Carbon/Carbon.h> May be needed?
# include <Carbon/Carbon.h>
#elif LL_LINUX
# include <errno.h>
# include <sys/utsname.h>

View File

@@ -293,7 +293,7 @@ int main(int argc, char **argv)
}
// Check for a change in this process's frontmost window.
if(FrontWindow() != front_window)
if(FrontNonFloatingWindow() != front_window)
{
ProcessSerialNumber self = { 0, kCurrentProcess };
ProcessSerialNumber parent = { 0, kNoProcess };
@@ -319,7 +319,7 @@ int main(int argc, char **argv)
}
}
if((FrontWindow() != NULL) && (front_window == NULL))
if((FrontNonFloatingWindow() != NULL) && (front_window == NULL))
{
// Opening the first window
@@ -331,7 +331,7 @@ int main(int argc, char **argv)
if(layer_group)
{
SetWindowGroup(FrontWindow(), layer_group);
SetWindowGroup(FrontNonFloatingWindow(), layer_group);
}
if(parent_is_front_process)
@@ -340,9 +340,9 @@ int main(int argc, char **argv)
(void) SetFrontProcess( &self );
}
ActivateWindow(FrontWindow(), true);
ActivateWindow(FrontNonFloatingWindow(), true);
}
else if((FrontWindow() == NULL) && (front_window != NULL))
else if((FrontNonFloatingWindow() == NULL) && (front_window != NULL))
{
// Closing the last window
@@ -362,7 +362,7 @@ int main(int argc, char **argv)
window_hack_state = 2;
}
front_window = FrontWindow();
front_window = FrontNonFloatingWindow();
}
}

View File

@@ -461,10 +461,10 @@ class DarwinManifest(ViewerManifest):
# copy additional libs in <bundle>/Contents/MacOS/
self.path("../../libraries/universal-darwin/lib_release/libhunspell-1.2.dylib", dst="MacOS/libhunspell-1.2.dylib")
self.path("../../libraries/universal-darwin/lib_release/libndofdev.dylib", dst="MacOS/libndofdev.dylib")
self.path("../../libraries/universal-darwin/lib_release/libvorbisenc.2.dylib", dst="MacOS/libvorbisenc.2.dylib")
self.path("../../libraries/universal-darwin/lib_release/libvorbisfile.3.dylib", dst="MacOS/libvorbisfile.3.dylib")
self.path("../../libraries/universal-darwin/lib_release/libvorbis.0.dylib", dst="MacOS/libvorbis.0.dylib")
self.path("../../libraries/universal-darwin/lib_release/libogg.0.dylib", dst="MacOS/libogg.0.dylib")
#self.path("../../libraries/universal-darwin/lib_release/libvorbisenc.2.dylib", dst="MacOS/libvorbisenc.2.dylib")
#self.path("../../libraries/universal-darwin/lib_release/libvorbisfile.3.dylib", dst="MacOS/libvorbisfile.3.dylib")
#self.path("../../libraries/universal-darwin/lib_release/libvorbis.0.dylib", dst="MacOS/libvorbis.0.dylib")
#self.path("../../libraries/universal-darwin/lib_release/libogg.0.dylib", dst="MacOS/libogg.0.dylib")
# most everything goes in the Resources directory
if self.prefix(src="", dst="Resources"):
@@ -520,8 +520,11 @@ class DarwinManifest(ViewerManifest):
self.path(self.args['configuration'] + "/libfmodwrapper.dylib", "libfmodwrapper.dylib")
# our apps
self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app")
#self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app")
try:
self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app")
self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app")
except:
pass
# plugin launcher
self.path("../llplugin/slplugin/" + self.args['configuration'] + "/SLPlugin.app", "SLPlugin.app")
@@ -534,14 +537,17 @@ class DarwinManifest(ViewerManifest):
"libaprutil-1.0.3.8.dylib",
"libexpat.0.5.0.dylib"):
target_lib = os.path.join('../../..', libfile)
self.run_command("ln -sf %(target)r %(link)r" %
{'target': target_lib,
'link' : os.path.join(mac_crash_logger_res_path, libfile)}
)
self.run_command("ln -sf %(target)r %(link)r" %
{'target': target_lib,
'link' : os.path.join(slplugin_res_path, libfile)}
)
try:
self.run_command("ln -sf %(target)r %(link)r" %
{'target': target_lib,
'link' : os.path.join(mac_crash_logger_res_path, libfile)}
)
except:
pass
# plugins
if self.prefix(src="", dst="llplugin"):

View File

@@ -63,12 +63,21 @@ else (WINDOWS)
set(WINDOWS_API_LIBRARIES "")
endif (WINDOWS)
if (DARWIN)
include(CMakeFindFrameworks)
find_library(APPKIT_LIBRARY AppKit)
find_library(CARBON_LIBRARY Carbon)
find_library(IOKIT_LIBRARY IOKit)
set(OSX_FILE_LIBRARIES ${APPKIT_LIBRARY} ${CARBON_LIBRARY} ${IOKIT_LIBRARY})
endif (DARWIN)
target_link_libraries(basic_plugin_filepicker
${LLPLUGIN_LIBRARIES}
${LLCOMMON_LIBRARIES}
${BASIC_PLUGIN_BASE_LIBRARIES}
${UI_LIBRARIES}
${WINDOWS_API_LIBRARIES}
${OSX_FILE_LIBRARIES}
)
add_dependencies(basic_plugin_filepicker

View File

@@ -189,16 +189,12 @@ OSStatus LLDirPicker::doNavChooseDialog()
error = NavCreateChooseFolderDialog(&mNavOptions, &doNavCallbackEvent, NULL, NULL, &navRef);
gViewerWindow->mWindow->beforeDialog();
if (error == noErr)
{
PLS_FLUSH;
error = NavDialogRun(navRef);
}
gViewerWindow->mWindow->afterDialog();
if (error == noErr)
error = NavDialogGetReply(navRef, &navReply);
@@ -232,7 +228,7 @@ BOOL LLDirPicker::getDir(std::string const& folder)
BOOL success = FALSE;
OSStatus error = noErr;
mFileName = folder;
mFileName = const_cast<std::string*>(&folder);
// mNavOptions.saveFileName

View File

@@ -761,7 +761,7 @@ Boolean LLFilePickerBase::navOpenFilterProc(AEDesc *theItem, void *info, void *c
}
else if (filter == FFLOAD_XML)
{
if (fileInfo.filetype != 'XML' &&
if (fileInfo.filetype != 'XML ' &&
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("xml"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
)
{
@@ -785,7 +785,7 @@ Boolean LLFilePickerBase::navOpenFilterProc(AEDesc *theItem, void *info, void *c
}
else if (filter == FFLOAD_RAW)
{
if (fileInfo.filetype != L'\?\?\?\?' &&
if (fileInfo.filetype != '\?\?\?\?' &&
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("raw"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
)
{
@@ -952,14 +952,14 @@ OSStatus LLFilePickerBase::doNavSaveDialog(ESaveFilter filter, std::string const
extension = CFSTR(".png");
break;
case FFSAVE_AVI:
type = L'\?\?\?\?';
creator = L'\?\?\?\?';
type = '\?\?\?\?';
creator = '\?\?\?\?';
extension = CFSTR(".mov");
break;
case FFSAVE_ANIM:
type = L'\?\?\?\?';
creator = L'\?\?\?\?';
type = '\?\?\?\?';
creator = '\?\?\?\?';
extension = CFSTR(".xaf");
break;
@@ -971,26 +971,26 @@ OSStatus LLFilePickerBase::doNavSaveDialog(ESaveFilter filter, std::string const
break;
#endif
case FFSAVE_RAW:
type = L'\?\?\?\?';
creator = L'\?\?\?\?';
type = '\?\?\?\?';
creator = '\?\?\?\?';
extension = CFSTR(".raw");
break;
case FFSAVE_J2C:
type = L'\?\?\?\?';
type = '\?\?\?\?';
creator = 'prvw';
extension = CFSTR(".j2c");
break;
case FFSAVE_ALL:
default:
type = L'\?\?\?\?';
creator = L'\?\?\?\?';
type = '\?\?\?\?';
creator = '\?\?\?\?';
extension = CFSTR("");
break;
}
NavEventUPP eventUPP = NewNavEventUPP(navSetDefaultFolderProc);
NavEventUPP eventUPP = NewNavEventUPP(NULL); //TODO: test filepicker
mFolder = folder;
// Create the dialog

View File

@@ -39,6 +39,7 @@
#ifndef LL_LLFILEPICKER_H
#define LL_LLFILEPICKER_H
#include "basic_plugin_base.h" // For PLS_INFOS etc.
#include "legacy.h"
#include <vector>
@@ -163,10 +164,10 @@ private:
#if LL_DARWIN
NavDialogCreationOptions mNavOptions;
OSStatus doNavChooseDialog(ELoadFilter filter);
OSStatus doNavSaveDialog(ESaveFilter filter, const std::string& filename);
OSStatus doNavChooseDialog(ELoadFilter filter, const std::string& folder);
OSStatus doNavSaveDialog(ESaveFilter filter, const std::string& filename, const std::string& folder);
static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode);
static pascal void LLFilePickerBase::doNavCallbackEvent(NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, void* callBackUD);
static pascal void doNavCallbackEvent(NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, void* callBackUD);
ELoadFilter getLoadFilter(void) const { return mLoadFilter; }
std::string const& getFolder(void) const { return mFolder; }
#endif // LL_DARWIN
@@ -189,6 +190,7 @@ public:
#endif // LL_GTK
#if !LL_WINDOWS && !(LL_GTK && LL_X11)
public:
void setWindowID(unsigned long window_id) { PLS_WARNS << "Calling unimplemented LLFilePickerBase::setWindowID" << PLS_ENDL; }
#endif