Fix flags to compile Skia on macOS which fixes exception handling

On Clang/macOS we cannot mix projects compiled with -fno-rtti that use
std::__throw_bad_weak_ptr() function and expect to catch
std::runtime_error as an std::exception in our project (compiled with
-frtti).

Real fix to crash in c59f03a7a0 and other
crash like moving a layer below to the background, and maybe a lot of
other cases where exceptions are used.

Example of this bug: https://gist.github.com/dacap/7ddffbe401eb42620de397e47edfcc76
This commit is contained in:
David Capello 2018-04-28 11:58:34 -03:00
parent 41b97cde40
commit 160209cb25
2 changed files with 1 additions and 8 deletions

View File

@ -301,7 +301,7 @@ several minutes to finish:
cd skia
git checkout aseprite-m67
python tools/git-sync-deps
gn gen out/Release --args="is_official_build=true skia_use_system_expat=false skia_use_system_icu=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false"
gn gen out/Release --args="is_official_build=true skia_use_system_expat=false skia_use_system_icu=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false extra_cflags_cc=[\"-frtti\"]"
ninja -C out/Release
After this you should have all Skia libraries compiled. When you

View File

@ -94,13 +94,6 @@ void Job::startJob()
catch (const std::exception& ex) {
Console::showException(ex);
}
// TODO This is required by Clang to show the
// std::runtime_error() from base/file_handle.cpp library. I
// don't get this, it looks like a Clang bug, because this
// should be caught by the std::exception case.
catch (const std::runtime_error& ex) {
Console::showException(ex);
}
catch (...) {
Console console;
console.printf("Unknown error performing the task");