Skip to content

Commit

Permalink
Export C/C++ compiler found in Cxx_flags
Browse files Browse the repository at this point in the history
Signed-off-by: Antonin Décimo <antonin@tarides.com>
  • Loading branch information
MisterDA committed Jan 15, 2021
1 parent a56cbce commit b73f68f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dune_rules/cxx_flags.ml
Original file line number Diff line number Diff line change
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;
base_cxx_flags ccomp_type
(ccomp_type, base_cxx_flags ccomp_type)
9 changes: 8 additions & 1 deletion src/dune_rules/cxx_flags.mli
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ open! Stdune

open Dune_engine

(** The detected compiler *)
type ccomp_type =
| Gcc
| Msvc
| Clang
| Other of string

(** The name of the file created in the .dune folder after calling the C
preprocessor *)
val preprocessed_filename : string

(** [get_flags c_compiler] returns the necessary flags to turn this compiler
into a c++ compiler for some of the most common compilers *)
val get_flags : Path.Build.t -> string list Build.t
val get_flags : Path.Build.t -> (ccomp_type * string list) Build.t
2 changes: 1 addition & 1 deletion src/dune_rules/super_context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let default_context_flags (ctx : Context.t) ~project =
let c = cflags @ Ocaml_config.ocamlc_cppflags ctx.ocaml_config in
let cxx =
let open Build.O in
let+ db_flags = Cxx_flags.get_flags ctx.build_dir in
let+ _, db_flags = Cxx_flags.get_flags ctx.build_dir in
db_flags @ cxxflags
in
(Build.return c, cxx)
Expand Down

0 comments on commit b73f68f

Please sign in to comment.