Skip to content

Commit

Permalink
Added wasm module
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharad committed Nov 13, 2024
1 parent 62aff60 commit 2213f60
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.stack-work/
*~
*~
dist-newstyle/
10 changes: 10 additions & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ executables:
- diagrams-lib
- diagrams-svg
- sql2er

sql2er-wasm:
main: Worker.hs
source-dirs: wasm
ghc-options:
- -no-hs-main
- -optl-mexec-model=reactor
- "-optl-Wl,--export=hs_runWorker"
dependencies:
- sql2er

tests:
sql2er-test:
Expand Down
15 changes: 15 additions & 0 deletions sql2er.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ executable sql2er-exe
, text
default-language: Haskell2010

executable sql2er-wasm
main-is: Worker.hs
other-modules:
Paths_sql2er
hs-source-dirs:
wasm
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -no-hs-main -optl-mexec-model=reactor -optl-Wl,--export=hs_runWorker
build-depends:
base >=4.7 && <5
, megaparsec
, optparse-applicative
, sql2er
, text
default-language: Haskell2010

test-suite sql2er-test
type: exitcode-stdio-1.0
main-is: Spec.hs
Expand Down
6 changes: 6 additions & 0 deletions wasm/Worker.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Worker where

foreign export ccall "hs_runWorker" runWorker :: IO ()

runWorker :: IO ()
runWorker = mempty

0 comments on commit 2213f60

Please sign in to comment.