mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
add script to generate jbuilder flags dynamically
This commit is contained in:
parent
a307bb09f7
commit
d97e1e7231
11 changed files with 40 additions and 25 deletions
|
|
@ -3,8 +3,7 @@
|
|||
((name containers)
|
||||
(public_name containers)
|
||||
(wrapped false)
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always -nolabels -open CCMonomorphic))
|
||||
(ocamlopt_flags (:standard -O3 -color always
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -nolabels -open CCMonomorphic))
|
||||
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||
(libraries (bytes result containers.monomorphic))
|
||||
))
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
((name containers_data)
|
||||
(public_name containers.data)
|
||||
(wrapped false)
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
||||
(ocamlopt_flags (:standard -O3 -color always
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||
(libraries (bytes result))
|
||||
))
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
((name containers_iter)
|
||||
(public_name containers.iter)
|
||||
(wrapped false)
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
||||
(ocamlopt_flags (:standard -O3 -color always
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||
(libraries (bytes result))
|
||||
))
|
||||
|
|
|
|||
10
src/jbuild
Normal file
10
src/jbuild
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
|
||||
(rule
|
||||
((targets (flambda.flags))
|
||||
(deps ((file mkflags.ml)))
|
||||
(fallback)
|
||||
(action
|
||||
(run ocaml ./mkflags.ml))
|
||||
))
|
||||
|
||||
13
src/mkflags.ml
Normal file
13
src/mkflags.ml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
let () =
|
||||
let major, minor =
|
||||
Scanf.sscanf Sys.ocaml_version "%u.%u"
|
||||
(fun major minor -> major, minor)
|
||||
in
|
||||
let after_4_3 = (major, minor) >= (4, 3) in
|
||||
let flags_file = open_out "flambda.flags" in
|
||||
if after_4_3 then (
|
||||
output_string flags_file "(-O3 -unbox-closures -unbox-closures-factor 20 -color always)\n";
|
||||
) else (
|
||||
output_string flags_file "()\n";
|
||||
);
|
||||
close_out flags_file
|
||||
|
|
@ -3,8 +3,7 @@
|
|||
((name containers_monomorphic)
|
||||
(public_name containers.monomorphic)
|
||||
(wrapped false)
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
||||
(ocamlopt_flags (:standard -O3 -color always
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||
(libraries ())
|
||||
))
|
||||
|
|
|
|||
|
|
@ -3,9 +3,8 @@
|
|||
((name containers_sexp)
|
||||
(public_name containers.sexp)
|
||||
(wrapped false)
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
||||
(ocamlopt_flags (:standard -O3 -color always
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||
(libraries (bytes result))
|
||||
))
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@
|
|||
(public_name containers.thread)
|
||||
(wrapped false)
|
||||
(optional)
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
||||
(ocamlopt_flags (:standard -O3 -color always
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||
(libraries (containers threads))
|
||||
))
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@
|
|||
((name containers_top)
|
||||
(public_name containers.top)
|
||||
(wrapped false)
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
||||
(ocamlopt_flags (:standard -O3 -color always
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||
(libraries (compiler-libs.common containers containers.data
|
||||
containers.unix containers.sexp containers.iter))
|
||||
))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
B ../../_build/default/src/unix
|
||||
FLG -w -40 -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always
|
||||
FLG -w -40 -w +a-4-42-44-48-50-58-32-60@8 -safe-string
|
||||
PKG bytes
|
||||
PKG result
|
||||
PKG unix
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@
|
|||
(public_name containers.unix)
|
||||
(wrapped false)
|
||||
(optional)
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
||||
(ocamlopt_flags (:standard -O3 -color always
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||
(libraries (bytes result unix))
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue