mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 11:45:31 -05:00
chore: update dune to use dune-config
This commit is contained in:
parent
5f521f6fa2
commit
13fe66c968
3 changed files with 23 additions and 15 deletions
|
|
@ -4,6 +4,6 @@
|
||||||
(public_name containers)
|
(public_name containers)
|
||||||
(wrapped false)
|
(wrapped false)
|
||||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -nolabels -open CCMonomorphic))
|
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -nolabels -open CCMonomorphic))
|
||||||
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
(ocamlopt_flags ((:include ../flambda.flags)))
|
||||||
(libraries (result uchar containers.monomorphic))
|
(libraries (result uchar containers.monomorphic))
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
|
|
||||||
|
(executable
|
||||||
|
((name mkflags)
|
||||||
|
(libraries (dune.configurator))))
|
||||||
|
|
||||||
(rule
|
(rule
|
||||||
((targets (flambda.flags))
|
((targets (flambda.flags))
|
||||||
(deps ((file mkflags.ml)))
|
|
||||||
(fallback)
|
(fallback)
|
||||||
(action
|
(action
|
||||||
(run ocaml ./mkflags.ml))
|
(run ./mkflags.exe))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,19 @@
|
||||||
|
|
||||||
|
module C = Configurator.V1
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
let major, minor =
|
C.main ~name:"mkflags" (fun c ->
|
||||||
Scanf.sscanf Sys.ocaml_version "%u.%u"
|
let version = C.ocaml_config_var_exn c "version" in
|
||||||
(fun major minor -> major, minor)
|
let major, minor =
|
||||||
in
|
Scanf.sscanf version "%u.%u"
|
||||||
let after_4_3 = (major, minor) >= (4, 3) in
|
(fun major minor -> major, minor)
|
||||||
let flags_file = open_out "flambda.flags" in
|
in
|
||||||
if after_4_3 then (
|
let after_4_3 = (major, minor) >= (4, 3) in
|
||||||
output_string flags_file "(-O3 -unbox-closures -unbox-closures-factor 20 -color always)\n";
|
let sexp =
|
||||||
) else (
|
if after_4_3 then (
|
||||||
output_string flags_file "()\n";
|
["-O3"; "-unbox-closures"; "-unbox-closures-factor"; "20"; "-color"; "always"]
|
||||||
);
|
) else (
|
||||||
close_out flags_file
|
[]
|
||||||
|
) in
|
||||||
|
C.Flags.write_sexp "flambda.flags" sexp
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue