summaryrefslogtreecommitdiff
path: root/compiler/utils/Platform.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-03-02 13:57:10 +0000
committerIan Lynagh <ian@well-typed.com>2013-03-02 13:59:03 +0000
commitff1de4cf60be4defda1945eb1dea55d056895c64 (patch)
treee40f32087139ac5d101dd1cec8023f2292afedd2 /compiler/utils/Platform.hs
parent7bc3bdf6ed6114ba04edcc1c3536b5e20218f20f (diff)
downloadhaskell-ff1de4cf60be4defda1945eb1dea55d056895c64.tar.gz
Add OSiOS, and define and use platformUsesFrameworks; part of #7720
Diffstat (limited to 'compiler/utils/Platform.hs')
-rw-r--r--compiler/utils/Platform.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index 090ce41f30..9e21326369 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -10,7 +10,8 @@ module Platform (
ArmABI(..),
target32Bit,
- osElfTarget
+ osElfTarget,
+ platformUsesFrameworks,
)
where
@@ -60,6 +61,7 @@ data OS
= OSUnknown
| OSLinux
| OSDarwin
+ | OSiOS
| OSSolaris2
| OSMinGW32
| OSFreeBSD
@@ -107,6 +109,7 @@ osElfTarget OSOpenBSD = True
osElfTarget OSNetBSD = True
osElfTarget OSSolaris2 = True
osElfTarget OSDarwin = False
+osElfTarget OSiOS = False
osElfTarget OSMinGW32 = False
osElfTarget OSKFreeBSD = True
osElfTarget OSHaiku = True
@@ -120,3 +123,11 @@ osElfTarget OSUnknown = False
-- portability, otherwise we have to answer this question for every
-- new platform we compile on (even unreg).
+osUsesFrameworks :: OS -> Bool
+osUsesFrameworks OSDarwin = True
+osUsesFrameworks OSiOS = True
+osUsesFrameworks _ = False
+
+platformUsesFrameworks :: Platform -> Bool
+platformUsesFrameworks = osUsesFrameworks . platformOS
+