From 798d367d54a6c6379ad355bd8345fa40e31e7fe9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 6 Sep 2008 18:24:57 -0500 Subject: Second Life viewer sources 1.21.0-RC --- linden/indra/mac_crash_logger/CMakeLists.txt | 79 ++++++++++++++++++++++ linden/indra/mac_crash_logger/llcrashloggermac.cpp | 14 ++-- linden/indra/mac_crash_logger/llcrashloggermac.h | 2 +- 3 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 linden/indra/mac_crash_logger/CMakeLists.txt (limited to 'linden/indra/mac_crash_logger') diff --git a/linden/indra/mac_crash_logger/CMakeLists.txt b/linden/indra/mac_crash_logger/CMakeLists.txt new file mode 100644 index 0000000..9cddb56 --- /dev/null +++ b/linden/indra/mac_crash_logger/CMakeLists.txt @@ -0,0 +1,79 @@ +# -*- cmake -*- + +project(mac_crash_logger) + +include(00-Common) +include(Boost) +include(LLCommon) +include(LLCrashLogger) +include(LLMath) +include(LLMessage) +include(LLVFS) +include(LLXML) +include(Linking) + +include_directories( + ${LLCOMMON_INCLUDE_DIRS} + ${LLCRASHLOGGER_INCLUDE_DIRS} + ${LLMATH_INCLUDE_DIRS} + ${LLVFS_INCLUDE_DIRS} + ${LLXML_INCLUDE_DIRS} + ) + +set(mac_crash_logger_SOURCE_FILES + mac_crash_logger.cpp + llcrashloggermac.cpp + ) + +set(mac_crash_logger_HEADER_FILES + CMakeLists.txt + + llcrashloggermac.h + ) + +set_source_files_properties(${mac_crash_logger_HEADER_FILES} + PROPERTIES HEADER_FILE_ONLY TRUE) +list(APPEND mac_crash_logger_SOURCE_FILES ${mac_crash_logger_HEADER_FILES}) + +set(mac_crash_logger_RESOURCE_FILES + Info.plist + CrashReporter.nib/ + ) +set_source_files_properties( + ${mac_crash_logger_RESOURCE_FILES} + PROPERTIES + HEADER_FILE_ONLY TRUE + ) +set_source_files_properties( + Info.plist + PROPERTIES + MACOSX_PACKAGE_LOCATION . # will it blend? + poppy + ) +SOURCE_GROUP("Resources" FILES ${mac_crash_logger_RESOURCE_FILES}) +list(APPEND mac_crash_logger_SOURCE_FILES ${mac_crash_logger_RESOURCE_FILES}) + +add_executable(mac-crash-logger + MACOSX_BUNDLE + ${mac_crash_logger_SOURCE_FILES}) + +target_link_libraries(mac-crash-logger + ${LLCRASHLOGGER_LIBRARIES} + ${LLVFS_LIBRARIES} + ${LLXML_LIBRARIES} + ${LLMESSAGE_LIBRARIES} + ${LLVFS_LIBRARIES} + ${LLMATH_LIBRARIES} + ${LLCOMMON_LIBRARIES} + ${BOOST_SIGNALS_LIBRARY} + ) + +add_custom_command( + TARGET mac-crash-logger POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS + -E + copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/CrashReporter.nib + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-crash-logger.app/Contents/Resources/CrashReporter.nib + ) + diff --git a/linden/indra/mac_crash_logger/llcrashloggermac.cpp b/linden/indra/mac_crash_logger/llcrashloggermac.cpp index 36d8285..8ed2ec7 100644 --- a/linden/indra/mac_crash_logger/llcrashloggermac.cpp +++ b/linden/indra/mac_crash_logger/llcrashloggermac.cpp @@ -57,7 +57,7 @@ LLFILE *gDebugFile = NULL; WindowRef gWindow = NULL; EventHandlerRef gEventHandler = NULL; -LLString gUserNotes = ""; +std::string gUserNotes = ""; bool gSendReport = false; bool gRememberChoice = false; IBNibRef nib = NULL; @@ -217,16 +217,16 @@ void LLCrashLoggerMac::gatherPlatformSpecificFiles() if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) { struct stat dw_stat; - LLString mBuf; + std::string mBuf; bool isLeopard = false; // Try the 10.3 path first... - LLString dw_file_name = LLString(path) + LLString("/CrashReporter/Second Life.crash.log"); + std::string dw_file_name = std::string(path) + std::string("/CrashReporter/Second Life.crash.log"); int res = stat(dw_file_name.c_str(), &dw_stat); if (res) { // Try the 10.2 one next... - dw_file_name = LLString(path) + LLString("/Second Life.crash.log"); + dw_file_name = std::string(path) + std::string("/Second Life.crash.log"); res = stat(dw_file_name.c_str(), &dw_stat); } @@ -235,8 +235,8 @@ void LLCrashLoggerMac::gatherPlatformSpecificFiles() //10.5: Like 10.3+, except it puts the crash time in the file instead of dividing it up //using asterisks. Get a directory listing, search for files starting with second life, //use the last one found. - LLString old_file_name, current_file_name, pathname, mask; - pathname = LLString(path) + LLString("/CrashReporter/"); + std::string old_file_name, current_file_name, pathname, mask; + pathname = std::string(path) + std::string("/CrashReporter/"); mask = "Second Life*"; while(gDirUtilp->getNextFileInDir(pathname, mask, current_file_name, false)) { @@ -331,7 +331,7 @@ bool LLCrashLoggerMac::mainLoop() return true; } -void LLCrashLoggerMac::updateApplication(LLString message) +void LLCrashLoggerMac::updateApplication(const std::string& message) { LLCrashLogger::updateApplication(); } diff --git a/linden/indra/mac_crash_logger/llcrashloggermac.h b/linden/indra/mac_crash_logger/llcrashloggermac.h index 5577b52..292579d 100644 --- a/linden/indra/mac_crash_logger/llcrashloggermac.h +++ b/linden/indra/mac_crash_logger/llcrashloggermac.h @@ -43,7 +43,7 @@ public: ~LLCrashLoggerMac(void); virtual bool init(); virtual bool mainLoop(); - virtual void updateApplication(LLString message = ""); + virtual void updateApplication(const std::string& message = LLStringUtil::null); virtual bool cleanup(); virtual void gatherPlatformSpecificFiles(); }; -- cgit v1.1