@@ -78,6 +78,11 @@ flag examples
7878 manual: True
7979 default: False
8080
81+flag examples-sdl
82+ description: Include examples that use SDL dependency
83+ manual: True
84+ default: False
85+
8186library
8287 hs-source-dirs: src
8388 other-modules: Streamly.Core
@@ -88,12 +93,15 @@ library
8893 , Streamly.Tutorial
8994 , Streamly
9095
91− if flag(examples)
92− exposed-modules: Streamly.Examples.SearchEngineQuery
96+ if flag(examples) || flag(examples-sdl)
97+ exposed-modules: Streamly.Examples
98+ , Streamly.Examples.SearchEngineQuery
9399 , Streamly.Examples.ListDirRecursive
94100 , Streamly.Examples.MergeSortedStreams
95101 , Streamly.Examples.AcidRainGame
96− , Streamly.Examples.CirclingSquare
102+
103+ if flag(examples-sdl)
104+ exposed-modules: Streamly.Examples.CirclingSquare
97105
98106 default-language: Haskell2010
99107 ghc-options: -Wall
@@ -111,6 +119,8 @@ library
111119 -Wredundant-constraints
112120 -Wnoncanonical-monad-instances
113121 -Wnoncanonical-monadfail-instances
122+ if flag(examples-sdl)
123+ cpp-options: -DEXAMPLES_SDL
114124
115125 build-depends: base >= 4.8 && < 5
116126 , atomic-primops >= 0.8 && < 0.9
@@ -128,12 +138,15 @@ library
128138 build-depends:
129139 semigroups >= 0.18 && < 0.19
130140
131− if flag(examples)
141+ if flag(examples) || flag(examples-sdl)
132142 build-Depends:
133143 http-conduit
134144 , path-io
135145 , random
136− , SDL >= 0.6.5 && < 0.7
146+
147+ if flag(examples-sdl)
148+ build-Depends:
149+ SDL >= 0.6.5 && < 0.7
137150
138151test-suite test
139152 type: exitcode-stdio-1.0