Skip to content

Commit

Permalink
Use match instead of assoc list
Browse files Browse the repository at this point in the history
Signed-off-by: Ulysse Gérard <[email protected]>
  • Loading branch information
voodoos committed Jan 13, 2021
1 parent a72b509 commit 0e2ed1d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/dune_rules/cxx_flags.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ type ccomp_type =
| Clang
| Other of string

let base_cxx_flags =
[ (Gcc, [ "-x"; "c++"; "-lstdc++"; "-shared-libgcc" ])
; (Clang, [ "-x"; "c++" ])
; (Msvc, [ "/TP" ])
]
let base_cxx_flags = function
| Gcc -> [ "-x"; "c++"; "-lstdc++"; "-shared-libgcc" ]
| Clang -> [ "-x"; "c++" ]
| Msvc -> [ "/TP" ]
| _ -> []

let preprocessed_filename = "ccomp"

Expand Down Expand Up @@ -42,4 +42,4 @@ let get_flags dir =
let open Build.O in
let+ ccomp_type = ccomp_type dir in
check_warn ccomp_type;
List.assoc_opt ccomp_type base_cxx_flags |> Option.value ~default:[]
base_cxx_flags ccomp_type

0 comments on commit 0e2ed1d

Please sign in to comment.