github 上にある MMDAI と MMDAI2 (VPVM) のミラーです
Revision | 17296934a1d66eb2fbc73526584cf2c4595994a6 (tree) |
---|---|
Zeit | 2014-04-05 17:45:13 |
Autor | hkrn <hikarin.jp@gmai...> |
Commiter | hkrn |
added crash reporter with PLCrashReporter on OSX
@@ -44,7 +44,8 @@ nvFX-* | ||
44 | 44 | nvtt-* |
45 | 45 | open_jtalk-* |
46 | 46 | openal-soft-* |
47 | -portaudio-src | |
47 | +plcrashreporter-* | |
48 | +portaudio-* | |
48 | 49 | regal-* |
49 | 50 | SDLMain.* |
50 | 51 | SDL2-* |
@@ -50,6 +50,7 @@ CppApplication { | ||
50 | 50 | readonly property string assimpLibrarySuffix: qbs.toolchain.contains("msvc") ? "" : debugLibrarySuffix.toUpperCase() |
51 | 51 | readonly property string nvFXLibrarySuffix: (cpp.architecture === "x86_64" ? "64" : "") + debugLibrarySuffix.toUpperCase() |
52 | 52 | readonly property string sparkleFrameworkBasePath: sourceDirectory + "/../Sparkle-src/build/Release" |
53 | + readonly property string plcrashreporterBasePath: sourceDirectory + "/../plcrashreporter-src" | |
53 | 54 | readonly property var commonLibraries: [ |
54 | 55 | "assimp" + assimpLibrarySuffix, |
55 | 56 | "FxParser" + nvFXLibrarySuffix, |
@@ -60,6 +61,15 @@ CppApplication { | ||
60 | 61 | "BulletCollision", |
61 | 62 | "LinearMath" |
62 | 63 | ] |
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") })) | |
63 | 73 | readonly property var commonIncludePaths: [ buildDirectory ].concat([ |
64 | 74 | "include", |
65 | 75 | "../VPAPI/include", |
@@ -100,15 +110,7 @@ CppApplication { | ||
100 | 110 | files: commonFiles |
101 | 111 | cpp.defines: commonDefiles |
102 | 112 | 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 | |
112 | 114 | Qt.quick.qmlDebugging: qbs.enableDebugCode |
113 | 115 | Group { |
114 | 116 | name: "Application" |
@@ -169,13 +171,12 @@ CppApplication { | ||
169 | 171 | } |
170 | 172 | return frameworks |
171 | 173 | } |
172 | - cpp.dynamicLibraries: commonLibraries.concat([ "alure-static", "openal", "tbb", "z" ]) | |
174 | + cpp.dynamicLibraries: commonLibraries.concat([ "alure-static", "openal", "tbb", "z", "CrashReporter-MacOSX-Static" ]) | |
173 | 175 | 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" ]) | |
179 | 180 | } |
180 | 181 | Properties { |
181 | 182 | condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("osx") |
@@ -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 | +} |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /** |
2 | 2 | |
3 | - Copyright (c) 2010-2013 hkrn | |
3 | + Copyright (c) 2010-2014 hkrn | |
4 | 4 | |
5 | 5 | All rights reserved. |
6 | 6 |
@@ -132,6 +132,10 @@ void registerQmlTypes() | ||
132 | 132 | |
133 | 133 | } |
134 | 134 | |
135 | +#ifdef Q_OS_MAC | |
136 | +extern void installCrashReporter(const Preference &preference); | |
137 | +#endif | |
138 | + | |
135 | 139 | int main(int argc, char *argv[]) |
136 | 140 | { |
137 | 141 | QCommandLineParser parser; |
@@ -149,6 +153,7 @@ int main(int argc, char *argv[]) | ||
149 | 153 | if (applicationPreference.isFontFamilyToGUIShared()) { |
150 | 154 | application.setFont(applicationPreference.fontFamily()); |
151 | 155 | } |
156 | + installCrashReporter(applicationPreference); | |
152 | 157 | prepareRegal(); |
153 | 158 | registerQmlTypes(); |
154 | 159 |