Some preliminary work on static linking.

This commit is contained in:
Benjamin Summers 2019-08-30 01:57:05 -07:00
parent 351eaca628
commit e5c0174800
2 changed files with 18 additions and 1 deletions

View File

@ -2,6 +2,12 @@ name: king
version: 0.1.0
license: AGPL-3.0-only
flags:
Release:
description: "Produce statically-linked executables"
default: false
manual: true
library:
source-dirs: lib
ghc-options:
@ -138,9 +144,16 @@ executables:
main: Main.hs
source-dirs: app
dependencies: ["king"]
when:
- condition: flag(Release)
then:
cc-options: -static
ld-options: -static -pthread
else: {}
ghc-options:
- -threaded
- -rtsopts
- -static
- -O2
- "-with-rtsopts=-N"
- -fwarn-incomplete-patterns
- -O0

View File

@ -18,6 +18,10 @@ nix:
ghc-options:
king: -fobject-code
flags:
king:
Release: false
# build:
# executable-profiling: true
# executable-stripping: false