Skip to content

Commit

Permalink
Merge pull request #3588 from mtzguido/misc
Browse files Browse the repository at this point in the history
Passing -thread in --ocamlc/--ocamlopt
  • Loading branch information
mtzguido authored Oct 21, 2024
2 parents adc24f9 + 7b34266 commit 06f57e0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
19 changes: 13 additions & 6 deletions ocaml/fstar-lib/generated/FStarC_OCaml.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions src/fstar/FStarC.OCaml.fst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
module FStarC.OCaml

open FStarC
open FStar.List.Tot.Base
open FStarC.Compiler
open FStarC.Compiler.Effect

Expand Down Expand Up @@ -45,18 +46,26 @@ let exec_in_ocamlenv #a (cmd : string) (args : list string) : a =
Util.execvp cmd (cmd :: args);
failwith "execvp failed"

let app_lib = "fstar.lib"
let plugin_lib = "fstar.lib"

(* OCaml Warning 8: this pattern-matching is not exhaustive.
This is usually benign as we check for exhaustivenss via SMT. *)
let wstr = "-8"

let common_args =
"-w" :: wstr ::
"-thread" ::
[]

let exec_ocamlc args =
exec_in_ocamlenv "ocamlfind"
("c" :: "-w" :: "-8" :: "-linkpkg" :: "-package" :: "fstar.lib" :: args)
("c" :: common_args @ "-linkpkg" :: "-package" :: app_lib :: args)

let exec_ocamlopt args =
exec_in_ocamlenv "ocamlfind"
("opt" :: "-w" :: "-8" :: "-linkpkg" :: "-package" :: "fstar.lib" :: args)
("opt" :: common_args @ "-linkpkg" :: "-package" :: app_lib :: args)

let exec_ocamlopt_plugin args =
exec_in_ocamlenv "ocamlfind"
("opt" :: "-w" :: "-8" :: "-shared" :: "-package" :: "fstar.lib" ::
args)
("opt" :: common_args @ "-shared" :: "-package" :: plugin_lib :: args)

0 comments on commit 06f57e0

Please sign in to comment.