File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ (* OASIS_START *)
2+ (* OASIS_STOP *)
3+ let oasis_env =
4+ BaseEnvLight. load
5+ ~filename: MyOCamlbuildBase. env_filename
6+ ~allow_empty: true
7+ ()
8+ let nonempty = function (A s ) -> String. length s != 0 | _ -> true
9+ let expand s = BaseEnvLight. var_expand s oasis_env;;
10+
11+ rule " piqic: piqi -> .ml & _ext.ml"
12+ ~prods: [" %_piqi.ml" ; " %_piqi_ext.ml" ]
13+ ~deps: [" %.piqi" ]
14+ (fun env _ ->
15+ Cmd (S (List. filter nonempty [A (expand " ${piqic}" ); A (expand " ${piqic_flags}" ); A " -I" ; A " .." ; A (env " %.piqi" ); A " --multi-format" ])));;
16+
17+ Ocamlbuild_plugin. dispatch dispatch_default;;
Original file line number Diff line number Diff line change 1+ (* OASIS_START *)
2+ (* OASIS_STOP *)
3+
4+ let def_piqic (() : unit ) : unit =
5+ let chop str = try
6+ Filename. chop_extension str
7+ with _ -> str in
8+ let piqic_path = BaseCheck. prog_best " piqic_path" [" piqic-ocaml" ; " piqic" ] () in
9+ BaseEnv. var_define " piqic_flags" (fun () ->
10+ if chop (Filename. basename (BaseEnv. var_get " piqic" ))
11+ = " piqic"
12+ then " ocaml"
13+ else " " ) |> ignore;
14+ BaseEnv. var_define " piqic" (fun () ->
15+ if (BaseStandardVar. os_type () = " Cygwin" ) || (BaseStandardVar. os_type () = " Win32" )
16+ then String. concat " "
17+ (OASISExec. run_read_output ~ctxt: ! BaseContext. default " cygpath" [piqic_path])
18+ else piqic_path) |> ignore
19+
20+ let () =
21+ def_piqic () ;
22+ setup () ;;
You can’t perform that action at this time.
0 commit comments