Skip to content

Commit cce2437

Browse files
committed
add myocamlbuild.ml file for building of static executable
1 parent 12d5d23 commit cce2437

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ debug: sanity
2222
$(OCB) -tag debug src/moloss.byte
2323

2424
static: sanity
25-
$(OCB) -tag custom src/moloss.native
25+
STATIC=true $(OCB) -tag custom src/moloss.native
2626

2727
# tests
2828
various_tests: native

_tags

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ true: use_menhir
99
<src/smtmsat.ml>: package(msat)
1010
<**/moloss.*>: package(unix), package(minisat), package(msat)
1111

12-
# compiler options
13-
true: ccopt(-static)
14-
1512
# Local Variables:
1613
# mode: conf
1714
# End:

myocamlbuild.ml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
open Ocamlbuild_plugin
2+
3+
let () =
4+
dispatch begin function
5+
| After_hygiene ->
6+
if getenv "STATIC" ~default:"false" = "true" then
7+
tag_any ["ccopt(-static)"]
8+
| _ -> ()
9+
end

0 commit comments

Comments
 (0)