Skip to content

Commit

Permalink
Add use-native build flag
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Aug 8, 2022
1 parent 38454ec commit 31b80ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/Streamly/Internal/System/Process.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ module Streamly.Internal.System.Process
)
where

-- #define USE_NATIVE

import Control.Exception (Exception(..), catch, throwIO)
import Control.Monad (void, unless)
import Control.Monad.Catch (MonadCatch, throwM)
Expand Down
19 changes: 14 additions & 5 deletions streamly-process.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ flag use-gauge
manual: True
default: False

flag use-native
description: Do not depend on the process package
manual: True
default: False

common compile-options
default-language: Haskell2010
ghc-options:
Expand All @@ -70,6 +75,8 @@ common optimization-options
-fdicts-strict
-fspec-constr-recursive=16
-fmax-worker-args=16
if flag(use-native)
cpp-options: -DUSE_NATIVE

library
import: compile-options, optimization-options
Expand All @@ -78,18 +85,20 @@ library
Streamly.System.Process
Streamly.Internal.System.Process
Streamly.Internal.System.Command
if !os(windows)
if flag (use-native) && !os(windows)
exposed-modules:
Streamly.Internal.System.Process.Posix
build-depends:
base >= 4.8 && < 5
, exceptions >= 0.8 && < 0.11
, process >= 1.0 && < 1.7
-- Uses internal APIs
, streamly == 0.9.0.*
if !os(windows)
build-depends:
unix >= 2.5 && < 2.8
if !flag(use-native)
build-depends: process >= 1.0 && < 1.7
else
if !os(windows)
build-depends:
unix >= 2.5 && < 2.8

-------------------------------------------------------------------------------
-- Benchmarks
Expand Down

0 comments on commit 31b80ab

Please sign in to comment.