You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
967 B
41 lines
967 B
7 years ago
|
(* -*- tuareg -*- *)
|
||
|
|
||
|
let common_flags =
|
||
|
{|(-w +a-3-4-9-18-40-42-44-48@50
|
||
|
-strict-formats -strict-sequence -principal
|
||
|
-short-paths -bin-annot -keep-docs
|
||
|
-unboxed-types)|}
|
||
|
|
||
|
|
||
|
let ocamlc_flags =
|
||
|
match Jbuild_plugin.V1.context with
|
||
|
| "dbg" -> "-g -opaque"
|
||
|
| _ -> "-w -26-32 -noassert"
|
||
|
|
||
|
|
||
|
let ocamlopt_flags =
|
||
|
match Jbuild_plugin.V1.context with
|
||
|
| "dbg" -> ocamlc_flags
|
||
|
| _ -> ocamlc_flags ^ " -w -a -O3"
|
||
|
|
||
|
|
||
|
let ppx_trace_flags =
|
||
|
match Jbuild_plugin.V1.context with
|
||
|
| "dbg" -> "--debug"
|
||
|
| _ -> ""
|
||
|
|
||
|
|
||
|
let flags deps =
|
||
|
Printf.sprintf
|
||
|
{|(flags (%s %s))
|
||
|
(ocamlc_flags (%s))
|
||
|
(ocamlopt_flags (%s))
|
||
|
(preprocess (pps (ppx_compare ppx_sexp_conv ppx_trace %s ppx_driver.runner)))|}
|
||
|
common_flags
|
||
|
(String.concat " "
|
||
|
(List.map (fun d -> "-open " ^ String.capitalize_ascii d) ("core_kernel" :: deps)))
|
||
|
ocamlc_flags ocamlopt_flags ppx_trace_flags
|
||
|
|
||
|
|
||
|
let libraries deps = String.concat " " ("core_kernel" :: deps)
|