Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/malfunction_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -652,13 +652,16 @@ let setup_options options =
*)
| `Shared ->
Clflags.shared := true
| `Include dir ->
Clflags.include_dirs := dir :: !Clflags.include_dirs
| `Package s ->
let packages = String.split_on_char ',' s in
let dirs = List.map Findlib.package_directory packages in
Clflags.include_dirs := dirs @ !Clflags.include_dirs
| `ForPack s -> Clflags.for_package := Some s
| `Dontlink _ -> ()
| `Linkpkg -> ()
| `Debug -> Clflags.debug := true
| `Thread -> ()
| `Optimize -> Clflags.(
default_simplify_rounds := 2;
Expand Down Expand Up @@ -759,7 +762,7 @@ let delete_temps outfiles =
in
List.iter Misc.remove_file temps

type options = [`Verbose | `Shared | `ForPack of string | `Package of string | `Dontlink of string | `Linkpkg | `Thread | `Optimize | `Bytecode] list
type options = [`Verbose | `Shared | `ForPack of string | `Include of string | `Package of string | `Dontlink of string | `Linkpkg | `Debug | `Thread | `Optimize | `Bytecode] list

let ensure_cmi ~module_name ~filename =
let cmi = module_name ^ ".cmi" in
Expand Down
2 changes: 1 addition & 1 deletion src/malfunction_compiler.mli
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type outfiles
val delete_temps : outfiles -> unit

type options = [`Verbose | `Shared | `ForPack of string | `Package of string | `Dontlink of string | `Linkpkg | `Thread | `Optimize | `Bytecode] list
type options = [`Verbose | `Shared | `ForPack of string | `Include of string | `Package of string | `Dontlink of string | `Linkpkg | `Debug | `Thread | `Optimize | `Bytecode] list

val compile_module :
?options:options ->
Expand Down
2 changes: 2 additions & 0 deletions src/malfunction_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ let parse_args args =
| "-o" :: o :: rest -> output := Some o; parse_opts mode rest
| "-shared" :: rest -> opts := `Shared :: !opts; parse_opts mode rest
| "-for-pack" :: o :: rest -> opts := `ForPack o :: !opts; parse_opts mode rest
| "-I" :: s :: rest -> opts := `Include s :: !opts; parse_opts mode rest
| "-package" :: s :: rest -> opts := `Package s :: !opts; parse_opts mode rest
| "-dontlink" :: s :: rest ->
if mode = `Compile then (opts := `Dontlink s :: !opts; parse_opts mode rest)
else usage ()
| "-linkpkg" :: rest ->
if mode = `Compile then (opts := `Linkpkg :: !opts; parse_opts mode rest)
else usage ()
| "-g" :: rest -> opts := `Debug :: !opts; parse_opts mode rest
| "-thread" :: rest ->
if mode = `Compile then (opts := `Thread :: !opts; parse_opts mode rest)
else usage ()
Expand Down