mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
thanks to @whitequark, could use cppo for preprocessing files
This commit is contained in:
parent
786334dcce
commit
76c9254dec
4 changed files with 51 additions and 4 deletions
|
|
@ -4,4 +4,4 @@
|
|||
- Drup (Gabriel Radanne)
|
||||
- Jacques-Pascal Deplaix
|
||||
- Nicolas Braud-Santoni
|
||||
|
||||
- Whitequark (Peter Zotov)
|
||||
|
|
|
|||
2
_oasis
2
_oasis
|
|
@ -8,7 +8,7 @@ LicenseFile: LICENSE
|
|||
Plugins: META (0.3), DevFiles (0.3)
|
||||
OCamlVersion: >= 4.00.1
|
||||
BuildTools: ocamlbuild
|
||||
AlphaFeatures: compiled_setup_ml
|
||||
AlphaFeatures: ocamlbuild_more_args, compiled_setup_ml
|
||||
|
||||
Synopsis: A modular standard library focused on data structures.
|
||||
Description:
|
||||
|
|
|
|||
4
configure
vendored
4
configure
vendored
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# OASIS_START
|
||||
# DO NOT EDIT (digest: 82230d61386befb40bc7377608e1f16e)
|
||||
# DO NOT EDIT (digest: 6f7b8221311e800a7093dc3b793f67ca)
|
||||
set -e
|
||||
|
||||
FST=true
|
||||
|
|
@ -23,5 +23,5 @@ for i in "$@"; do
|
|||
esac
|
||||
done
|
||||
|
||||
make configure CONFIGUREFLAGS="$@"
|
||||
make configure CONFIGUREFLAGS="$*"
|
||||
# OASIS_STOP
|
||||
|
|
|
|||
47
myocamlbuild.ml
Normal file
47
myocamlbuild.ml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
(* OASIS_START *)
|
||||
(* OASIS_STOP *)
|
||||
|
||||
open Ocamlbuild_plugin;;
|
||||
|
||||
dispatch
|
||||
(MyOCamlbuildBase.dispatch_combine [
|
||||
begin function
|
||||
| After_rules ->
|
||||
(* replace with Ocamlbuild_cppo.dispatch when 4.00 is not supported
|
||||
anymore *)
|
||||
let dep = "%(name).cppo.ml" in
|
||||
let prod1 = "%(name: <*> and not <*.cppo>).ml" in
|
||||
let prod2 = "%(name: <**/*> and not <**/*.cppo>).ml" in
|
||||
let f prod env _build =
|
||||
let dep = env dep in
|
||||
let prod = env prod in
|
||||
let tags = tags_of_pathname prod ++ "cppo" in
|
||||
Cmd (S[A "cppo"; T tags; S [A "-o"; P prod]; P dep ])
|
||||
in
|
||||
rule "cppo1" ~dep ~prod:prod1 (f prod1) ;
|
||||
rule "cppo2" ~dep ~prod:prod2 (f prod2) ;
|
||||
pflag ["cppo"] "cppo_D" (fun s -> S [A "-D"; A s]) ;
|
||||
pflag ["cppo"] "cppo_U" (fun s -> S [A "-U"; A s]) ;
|
||||
pflag ["cppo"] "cppo_I" (fun s ->
|
||||
if Pathname.is_directory s then S [A "-I"; P s]
|
||||
else S [A "-I"; P (Pathname.dirname s)]
|
||||
) ;
|
||||
pdep ["cppo"] "cppo_I" (fun s ->
|
||||
if Pathname.is_directory s then [] else [s]) ;
|
||||
flag ["cppo"; "cppo_q"] (A "-q") ;
|
||||
flag ["cppo"; "cppo_s"] (A "-s") ;
|
||||
flag ["cppo"; "cppo_n"] (A "-n") ;
|
||||
pflag ["cppo"] "cppo_x" (fun s -> S [A "-x"; A s]);
|
||||
(* end replace *)
|
||||
|
||||
let major, minor = Scanf.sscanf Sys.ocaml_version "%d.%d.%d"
|
||||
(fun major minor patchlevel -> major, minor)
|
||||
in
|
||||
let ocaml_major = "OCAML_MAJOR " ^ string_of_int major in
|
||||
let ocaml_minor = "OCAML_MINOR " ^ string_of_int minor in
|
||||
|
||||
flag ["cppo"] & S[A"-D"; A ocaml_major; A"-D"; A ocaml_minor]
|
||||
| _ -> ()
|
||||
end;
|
||||
dispatch_default
|
||||
])
|
||||
Loading…
Add table
Reference in a new issue