• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

github 上にある MMDAI と MMDAI2 (VPVM) のミラーです


Commit MetaInfo

Revision17296934a1d66eb2fbc73526584cf2c4595994a6 (tree)
Zeit2014-04-05 17:45:13
Autorhkrn <hikarin.jp@gmai...>
Commiterhkrn

Log Message

added crash reporter with PLCrashReporter on OSX

Ändern Zusammenfassung

Diff

--- a/.gitignore
+++ b/.gitignore
@@ -44,7 +44,8 @@ nvFX-*
4444 nvtt-*
4545 open_jtalk-*
4646 openal-soft-*
47-portaudio-src
47+plcrashreporter-*
48+portaudio-*
4849 regal-*
4950 SDLMain.*
5051 SDL2-*
--- a/VPVM/VPVM.qbs
+++ b/VPVM/VPVM.qbs
@@ -50,6 +50,7 @@ CppApplication {
5050 readonly property string assimpLibrarySuffix: qbs.toolchain.contains("msvc") ? "" : debugLibrarySuffix.toUpperCase()
5151 readonly property string nvFXLibrarySuffix: (cpp.architecture === "x86_64" ? "64" : "") + debugLibrarySuffix.toUpperCase()
5252 readonly property string sparkleFrameworkBasePath: sourceDirectory + "/../Sparkle-src/build/Release"
53+ readonly property string plcrashreporterBasePath: sourceDirectory + "/../plcrashreporter-src"
5354 readonly property var commonLibraries: [
5455 "assimp" + assimpLibrarySuffix,
5556 "FxParser" + nvFXLibrarySuffix,
@@ -60,6 +61,15 @@ CppApplication {
6061 "BulletCollision",
6162 "LinearMath"
6263 ]
64+ readonly property var commonLibraryPaths: [ FileInfo.joinPaths(sourceDirectory, "../tbb-src/lib") ].concat([
65+ "../bullet-src",
66+ "../assimp-src",
67+ "../nvFX-src",
68+ "../alure-src",
69+ "../openal-soft-src",
70+ "../icu4c-src",
71+ "../zlib-src"
72+ ].map(function(x){ return FileInfo.joinPaths(sourceDirectory, x, libraryInstallDirectory, "lib") }))
6373 readonly property var commonIncludePaths: [ buildDirectory ].concat([
6474 "include",
6575 "../VPAPI/include",
@@ -100,15 +110,7 @@ CppApplication {
100110 files: commonFiles
101111 cpp.defines: commonDefiles
102112 cpp.includePaths: commonIncludePaths
103- cpp.libraryPaths: [ FileInfo.joinPaths(sourceDirectory, "../tbb-src/lib") ].concat([
104- "../bullet-src",
105- "../assimp-src",
106- "../nvFX-src",
107- "../alure-src",
108- "../openal-soft-src",
109- "../icu4c-src",
110- "../zlib-src"
111- ].map(function(x){ return FileInfo.joinPaths(sourceDirectory, x, libraryInstallDirectory, "lib") }))
113+ cpp.libraryPaths: commonLibraryPaths
112114 Qt.quick.qmlDebugging: qbs.enableDebugCode
113115 Group {
114116 name: "Application"
@@ -169,13 +171,12 @@ CppApplication {
169171 }
170172 return frameworks
171173 }
172- cpp.dynamicLibraries: commonLibraries.concat([ "alure-static", "openal", "tbb", "z" ])
174+ cpp.dynamicLibraries: commonLibraries.concat([ "alure-static", "openal", "tbb", "z", "CrashReporter-MacOSX-Static" ])
173175 cpp.minimumOsxVersion: "10.6"
174- cpp.infoPlistFile: "qt/osx/Info.plist"
175- cpp.infoPlist: ({
176- "CFBundleVersion": version,
177- "CFBundleShortVersionString": version
178- })
176+ cpp.infoPlistFile: FileInfo.joinPaths(sourceDirectory, "/qt/osx/Info.plist")
177+ cpp.infoPlist: ({ "CFBundleVersion": version, "CFBundleShortVersionString": version })
178+ cpp.includePaths: commonIncludePaths.concat([ plcrashreporterBasePath + "/Source" ])
179+ cpp.libraryPaths: commonLibraryPaths.concat([ plcrashreporterBasePath + "/build/Release-MacOSX" ])
179180 }
180181 Properties {
181182 condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("osx")
--- /dev/null
+++ b/VPVM/src/CrashReporter.mm
@@ -0,0 +1,54 @@
1+/**
2+
3+ Copyright (c) 2010-2014 hkrn
4+
5+ All rights reserved.
6+
7+ Redistribution and use in source and binary forms, with or
8+ without modification, are permitted provided that the following
9+ conditions are met:
10+
11+ - Redistributions of source code must retain the above copyright
12+ notice, this list of conditions and the following disclaimer.
13+ - Redistributions in binary form must reproduce the above
14+ copyright notice, this list of conditions and the following
15+ disclaimer in the documentation and/or other materials provided
16+ with the distribution.
17+ - Neither the name of the MMDAI project team nor the names of
18+ its contributors may be used to endorse or promote products
19+ derived from this software without specific prior written
20+ permission.
21+
22+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
27+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34+ POSSIBILITY OF SUCH DAMAGE.
35+
36+*/
37+
38+#include <CrashReporter.h>
39+#include <vpvl2/Common.h>
40+#include "Preference.h"
41+
42+using namespace vpvl2;
43+
44+void installCrashReporter(const Preference &preference)
45+{
46+ Q_UNUSED(preference);
47+ PLCrashReporterConfig *config = [[[PLCrashReporterConfig alloc] initWithSignalHandlerType:PLCrashReporterSignalHandlerTypeMach
48+ symbolicationStrategy:PLCrashReporterSymbolicationStrategyAll] autorelease];
49+ PLCrashReporter *reporter = [[[PLCrashReporter alloc] initWithConfiguration:config] autorelease];
50+ NSError *error = nil;
51+ if (![reporter enableCrashReporterAndReturnError:&error]) {
52+ VPVL2_LOG(WARNING, "Could not enable crash reporter: " << [[error localizedDescription] UTF8String]);
53+ }
54+}
--- a/VPVM/src/SharingService.mm
+++ b/VPVM/src/SharingService.mm
@@ -1,6 +1,6 @@
11 /**
22
3- Copyright (c) 2010-2013 hkrn
3+ Copyright (c) 2010-2014 hkrn
44
55 All rights reserved.
66
--- a/VPVM/src/main.cc
+++ b/VPVM/src/main.cc
@@ -132,6 +132,10 @@ void registerQmlTypes()
132132
133133 }
134134
135+#ifdef Q_OS_MAC
136+extern void installCrashReporter(const Preference &preference);
137+#endif
138+
135139 int main(int argc, char *argv[])
136140 {
137141 QCommandLineParser parser;
@@ -149,6 +153,7 @@ int main(int argc, char *argv[])
149153 if (applicationPreference.isFontFamilyToGUIShared()) {
150154 application.setFont(applicationPreference.fontFamily());
151155 }
156+ installCrashReporter(applicationPreference);
152157 prepareRegal();
153158 registerQmlTypes();
154159