Skip to content

ICU extension flag #96

@moll

Description

@moll

Hey,

I wanted to use SQLite with ICU enabled, so here's a patch to enable it. Perhaps useful to add to Direct-SQLite-proper, too.

diff --git a/direct-sqlite.cabal b/direct-sqlite.cabal
index deb5d30..67bcc4e 100644
--- a/direct-sqlite.cabal
+++ b/direct-sqlite.cabal
@@ -48,6 +48,10 @@ flag json1
   description: Enable json1 extension.
   default: True
 
+flag icu
+  description: Enable the ICU extension.
+  default: False
+
 Library
   exposed-modules:
     Database.SQLite3
@@ -86,6 +90,11 @@ Library
     if flag(json1) {
       cc-options: -DSQLITE_ENABLE_JSON1
     }
+
+    if flag(icu) {
+      cc-options: -DSQLITE_ENABLE_ICU
+      extra-libraries: icui18n icuuc icudata
+    }
   }
 
   include-dirs: .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions