Get rid of link_executables in dune files (unused)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
This commit is contained in:
parent
e05c81ac56
commit
6abe76c4e7
|
@ -872,17 +872,22 @@ module Executables = struct
|
||||||
end
|
end
|
||||||
|
|
||||||
type t =
|
type t =
|
||||||
{ names : (Loc.t * string) list
|
{ names : (Loc.t * string) list
|
||||||
; link_executables : bool
|
; link_flags : Ordered_set_lang.Unexpanded.t
|
||||||
; link_flags : Ordered_set_lang.Unexpanded.t
|
; modes : Link_mode.Set.t
|
||||||
; modes : Link_mode.Set.t
|
; buildable : Buildable.t
|
||||||
; buildable : Buildable.t
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let common_v1 project names public_names ~multi =
|
let common project names public_names ~syntax ~multi =
|
||||||
Buildable.v1 >>= fun buildable ->
|
Buildable.v1 >>= fun buildable ->
|
||||||
field "link_executables" bool ~default:true >>= fun link_executables ->
|
(match (syntax : File_tree.Dune_file.Kind.t) with
|
||||||
field_oslu "link_flags" >>= fun link_flags ->
|
| Dune ->
|
||||||
|
return ()
|
||||||
|
| Jbuild ->
|
||||||
|
field "link_executables" bool ~default:true >>= fun _ ->
|
||||||
|
return ())
|
||||||
|
>>= fun () ->
|
||||||
|
field_oslu "link_flags" >>= fun link_flags ->
|
||||||
field "modes" Link_mode.Set.t ~default:Link_mode.Set.default
|
field "modes" Link_mode.Set.t ~default:Link_mode.Set.default
|
||||||
>>= fun modes ->
|
>>= fun modes ->
|
||||||
map_validate
|
map_validate
|
||||||
|
@ -896,7 +901,6 @@ module Executables = struct
|
||||||
>>= fun () ->
|
>>= fun () ->
|
||||||
let t =
|
let t =
|
||||||
{ names
|
{ names
|
||||||
; link_executables
|
|
||||||
; link_flags
|
; link_flags
|
||||||
; modes
|
; modes
|
||||||
; buildable
|
; buildable
|
||||||
|
@ -952,7 +956,7 @@ module Executables = struct
|
||||||
| "-" -> None
|
| "-" -> None
|
||||||
| s -> Some s
|
| s -> Some s
|
||||||
|
|
||||||
let v1_multi project =
|
let multi ~syntax project =
|
||||||
record
|
record
|
||||||
(field "names" (list (located string)) >>= fun names ->
|
(field "names" (list (located string)) >>= fun names ->
|
||||||
map_validate (field_o "public_names" (list public_name)) ~f:(function
|
map_validate (field_o "public_names" (list public_name)) ~f:(function
|
||||||
|
@ -964,13 +968,13 @@ module Executables = struct
|
||||||
Error "The list of public names must be of the same \
|
Error "The list of public names must be of the same \
|
||||||
length as the list of names")
|
length as the list of names")
|
||||||
>>= fun public_names ->
|
>>= fun public_names ->
|
||||||
common_v1 project names public_names ~multi:true)
|
common ~syntax project names public_names ~multi:true)
|
||||||
|
|
||||||
let v1_single project =
|
let single ~syntax project =
|
||||||
record
|
record
|
||||||
(field "name" (located string) >>= fun name ->
|
(field "name" (located string) >>= fun name ->
|
||||||
field_o "public_name" string >>= fun public_name ->
|
field_o "public_name" string >>= fun public_name ->
|
||||||
common_v1 project [name] [public_name] ~multi:false)
|
common ~syntax project [name] [public_name] ~multi:false)
|
||||||
end
|
end
|
||||||
|
|
||||||
module Rule = struct
|
module Rule = struct
|
||||||
|
@ -1256,10 +1260,10 @@ module Stanzas = struct
|
||||||
|
|
||||||
type constructors = Stanza.t list Sexp.Of_sexp.Constructor_spec.t list
|
type constructors = Stanza.t list Sexp.Of_sexp.Constructor_spec.t list
|
||||||
|
|
||||||
let common project : constructors =
|
let common project ~syntax : constructors =
|
||||||
[ cstr "library" (Library.v1 project @> nil) (fun x -> [Library x])
|
[ cstr "library" (Library.v1 project @> nil) (fun x -> [Library x])
|
||||||
; cstr "executable" (Executables.v1_single project @> nil) execs
|
; cstr "executable" (Executables.single project ~syntax @> nil) execs
|
||||||
; cstr "executables" (Executables.v1_multi project @> nil) execs
|
; cstr "executables" (Executables.multi project ~syntax @> nil) execs
|
||||||
; cstr "rule" (cstr_loc (Rule.v1 @> nil)) (fun loc x -> [Rule { x with loc }])
|
; cstr "rule" (cstr_loc (Rule.v1 @> nil)) (fun loc x -> [Rule { x with loc }])
|
||||||
; cstr "ocamllex" (cstr_loc (Rule.ocamllex_v1 @> nil))
|
; cstr "ocamllex" (cstr_loc (Rule.ocamllex_v1 @> nil))
|
||||||
(fun loc x -> rules (Rule.ocamllex_to_rule loc x))
|
(fun loc x -> rules (Rule.ocamllex_to_rule loc x))
|
||||||
|
@ -1280,13 +1284,13 @@ module Stanzas = struct
|
||||||
]
|
]
|
||||||
|
|
||||||
let dune project =
|
let dune project =
|
||||||
common project @
|
common project ~syntax:Dune @
|
||||||
[ cstr "env" (cstr_loc (rest Env.rule))
|
[ cstr "env" (cstr_loc (rest Env.rule))
|
||||||
(fun loc rules -> [Env { loc; rules }])
|
(fun loc rules -> [Env { loc; rules }])
|
||||||
]
|
]
|
||||||
|
|
||||||
let jbuild project =
|
let jbuild project =
|
||||||
common project @
|
common project ~syntax:Jbuild @
|
||||||
[ cstr "jbuild_version" (Jbuild_version.t @> nil) (fun _ -> [])
|
[ cstr "jbuild_version" (Jbuild_version.t @> nil) (fun _ -> [])
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -257,7 +257,6 @@ module Executables : sig
|
||||||
|
|
||||||
type t =
|
type t =
|
||||||
{ names : (Loc.t * string) list
|
{ names : (Loc.t * string) list
|
||||||
; link_executables : bool
|
|
||||||
; link_flags : Ordered_set_lang.Unexpanded.t
|
; link_flags : Ordered_set_lang.Unexpanded.t
|
||||||
; modes : Link_mode.Set.t
|
; modes : Link_mode.Set.t
|
||||||
; buildable : Buildable.t
|
; buildable : Buildable.t
|
||||||
|
|
Loading…
Reference in New Issue