nitg: do not use libunwind for platforms which do not support it
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 12 Mar 2014 19:56:27 +0000 (15:56 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 12 Mar 2014 20:23:40 +0000 (16:23 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/android_platform.nit
src/nitg.nit
src/platform.nit

index d888a32..34dfa25 100644 (file)
@@ -55,6 +55,8 @@ end
 class AndroidPlatform
        super Platform
 
+       redef fun supports_libunwind do return false
+
        redef fun toolchain(toolcontext) do return new AndroidToolchain(toolcontext)
 end
 
index f575b91..e4e965f 100644 (file)
@@ -71,6 +71,11 @@ else
        mainmodule.set_imported_mmodules(mmodules)
 end
 
+var platform = mainmodule.target_platform
+if platform != null and not platform.supports_libunwind then
+       toolcontext.opt_no_stacktrace.value = true
+       toolcontext.opt_stacktrace.value = false
+end
 
 if toolcontext.opt_erasure.value then
        modelbuilder.run_separate_erasure_compiler(mainmodule, null)
index 3d15546..4d65c7e 100644 (file)
@@ -112,4 +112,5 @@ end
 #
 # Services will be added to this class in other modules.
 abstract class Platform
+       fun supports_libunwind: Bool do return true
 end