From a638486bb3a9b212d15775d0bc63de2e619e0518 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Fri, 8 Apr 2022 15:42:22 +0100 Subject: [PATCH] add swift flag to package.yaml --- package.yaml | 13 ++++++++++++- simplexmq.cabal | 18 +++++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/package.yaml b/package.yaml index f87ca111b..a06edb7f6 100644 --- a/package.yaml +++ b/package.yaml @@ -1,7 +1,7 @@ name: simplexmq version: 1.0.3 synopsis: SimpleXMQ message broker -description: | +description: | This package includes <./docs/Simplex-Messaging-Server.html server>, <./docs/Simplex-Messaging-Client.html client> and <./docs/Simplex-Messaging-Agent.html agent> for SMP protocols: @@ -64,6 +64,17 @@ dependencies: - x509-store == 1.6.* - x509-validation == 1.6.* +flags: + swift: + description: Enable swift JSON format + manual: True + default: False + +when: + - condition: flag(swift) + ghc-options: + - -DswiftJSON + library: source-dirs: src diff --git a/simplexmq.cabal b/simplexmq.cabal index 9bc4b79e3..2d40d77ee 100644 --- a/simplexmq.cabal +++ b/simplexmq.cabal @@ -28,9 +28,9 @@ extra-source-files: CHANGELOG.md flag swift - Description: Enable swift JSON format - Default: False - Manual: True + description: Enable swift JSON format + manual: True + default: False library exposed-modules: @@ -73,10 +73,6 @@ library hs-source-dirs: src ghc-options: -Wall -Wcompat -Werror=incomplete-patterns -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns -Wunused-type-patterns - - if flag(swift) - ghc-options: "-DswiftJSON" - build-depends: QuickCheck ==2.14.* , aeson ==2.0.* @@ -119,6 +115,8 @@ library , x509 ==1.7.* , x509-store ==1.6.* , x509-validation ==1.6.* + if flag(swift) + ghc-options: -DswiftJSON default-language: Haskell2010 executable smp-agent @@ -171,6 +169,8 @@ executable smp-agent , x509 ==1.7.* , x509-store ==1.6.* , x509-validation ==1.6.* + if flag(swift) + ghc-options: -DswiftJSON default-language: Haskell2010 executable smp-server @@ -226,6 +226,8 @@ executable smp-server , x509 ==1.7.* , x509-store ==1.6.* , x509-validation ==1.6.* + if flag(swift) + ghc-options: -DswiftJSON default-language: Haskell2010 test-suite smp-server-test @@ -294,4 +296,6 @@ test-suite smp-server-test , x509 ==1.7.* , x509-store ==1.6.* , x509-validation ==1.6.* + if flag(swift) + ghc-options: -DswiftJSON default-language: Haskell2010