Interpret extra_disabled_warnings
This commit is contained in:
parent
0281a95f2c
commit
e75f0e4455
|
@ -416,8 +416,7 @@ module Library = struct
|
||||||
|
|
||||||
let t =
|
let t =
|
||||||
record
|
record
|
||||||
~ignore:["inline_tests"; "skip_from_default";
|
~ignore:["inline_tests"; "skip_from_default"; "lint"]
|
||||||
"extra_disabled_warnings"; "lint"]
|
|
||||||
[ field "name" library_name
|
[ field "name" library_name
|
||||||
; field_o "public_name" string
|
; field_o "public_name" string
|
||||||
; field_o "synopsis" string
|
; field_o "synopsis" string
|
||||||
|
@ -445,12 +444,14 @@ module Library = struct
|
||||||
; field_osl "flags"
|
; field_osl "flags"
|
||||||
; field_osl "ocamlc_flags"
|
; field_osl "ocamlc_flags"
|
||||||
; field_osl "ocamlopt_flags"
|
; field_osl "ocamlopt_flags"
|
||||||
|
; field "extra_disabled_warnings" (list int) ~default:[]
|
||||||
]
|
]
|
||||||
(fun name public_name synopsis install_c_headers libraries ppx_runtime_libraries
|
(fun name public_name synopsis install_c_headers libraries ppx_runtime_libraries
|
||||||
modules c_flags cxx_flags c_names cxx_names library_flags c_libraries
|
modules c_flags cxx_flags c_names cxx_names library_flags c_libraries
|
||||||
c_library_flags preprocess
|
c_library_flags preprocess
|
||||||
preprocessor_deps self_build_stubs_archive js_of_ocaml virtual_deps modes
|
preprocessor_deps self_build_stubs_archive js_of_ocaml virtual_deps modes
|
||||||
includes kind wrapped optional flags ocamlc_flags ocamlopt_flags ->
|
includes kind wrapped optional flags ocamlc_flags ocamlopt_flags
|
||||||
|
extra_disabled_warnings ->
|
||||||
{ name
|
{ name
|
||||||
; public_name
|
; public_name
|
||||||
; synopsis
|
; synopsis
|
||||||
|
@ -478,7 +479,17 @@ module Library = struct
|
||||||
; virtual_deps
|
; virtual_deps
|
||||||
; wrapped
|
; wrapped
|
||||||
; optional
|
; optional
|
||||||
; flags
|
; flags =
|
||||||
|
if Ordered_set_lang.is_standard flags && extra_disabled_warnings <> [] then
|
||||||
|
Ordered_set_lang.append flags
|
||||||
|
(Ordered_set_lang.t
|
||||||
|
(List [ Atom "-w"
|
||||||
|
; Atom
|
||||||
|
(String.concat ~sep:""
|
||||||
|
(List.map extra_disabled_warnings ~f:(sprintf "-%d")))
|
||||||
|
]))
|
||||||
|
else
|
||||||
|
flags
|
||||||
; ocamlc_flags
|
; ocamlc_flags
|
||||||
; ocamlopt_flags
|
; ocamlopt_flags
|
||||||
})
|
})
|
||||||
|
|
|
@ -55,12 +55,14 @@ let rec map (t : t) ~f =
|
||||||
|
|
||||||
let standard : t = Atom ":standard"
|
let standard : t = Atom ":standard"
|
||||||
|
|
||||||
|
let append a b = Sexp.List [a; b]
|
||||||
|
|
||||||
module Unexpanded = struct
|
module Unexpanded = struct
|
||||||
type nonrec t = t
|
type nonrec t = t
|
||||||
let t t = t
|
let t t = t
|
||||||
let standard = standard
|
let standard = standard
|
||||||
|
|
||||||
let append a b = Sexp.List [a; b]
|
let append = append
|
||||||
|
|
||||||
let files t =
|
let files t =
|
||||||
let rec loop acc : t -> _ = function
|
let rec loop acc : t -> _ = function
|
||||||
|
|
|
@ -9,6 +9,7 @@ val t : Sexp.t -> t
|
||||||
val eval_with_standard : t -> standard:string list -> string list
|
val eval_with_standard : t -> standard:string list -> string list
|
||||||
val standard : t
|
val standard : t
|
||||||
val is_standard : t -> bool
|
val is_standard : t -> bool
|
||||||
|
val append : t -> t -> t
|
||||||
|
|
||||||
(** Map non-variable atoms *)
|
(** Map non-variable atoms *)
|
||||||
val map : t -> f:(string -> string) -> t
|
val map : t -> f:(string -> string) -> t
|
||||||
|
|
Loading…
Reference in New Issue