Don't pass -g to cl; it doesn't like it! (#120)

The Microsoft C compiler doesn't recognise -g. For now, easier just not
to compile with any debugging information on MSVC.

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
This commit is contained in:
David Allsopp 2017-06-05 11:40:27 +01:00 committed by Jérémie Dimino
parent 624b32b241
commit 7ec081419c
3 changed files with 11 additions and 2 deletions

View File

@ -459,3 +459,9 @@ let best_mode t : Mode.t =
match t.ocamlopt with
| Some _ -> Native
| None -> Byte
let cc_g (ctx : t) =
if !Clflags.g && ctx.ccomp_type <> "msvc" then
["-g"]
else
[]

View File

@ -154,3 +154,6 @@ val compiler : t -> Mode.t -> Path.t option
(** The best compilation mode for this context *)
val best_mode : t -> Mode.t
(** [\["-g"\]] if [!Clflags.g] and [\[\]] otherwise *)
val cc_g : t -> string list

View File

@ -100,7 +100,7 @@ module Gen(P : Params) = struct
(Build.paths h_files
>>>
Build.fanout
(SC.expand_and_eval_set ~dir lib.c_flags ~standard:(Utils.g ()))
(SC.expand_and_eval_set ~dir lib.c_flags ~standard:(Context.cc_g ctx))
requires
>>>
Build.run ~context:ctx
@ -125,7 +125,7 @@ module Gen(P : Params) = struct
(Build.paths h_files
>>>
Build.fanout
(SC.expand_and_eval_set ~dir lib.cxx_flags ~standard:(Utils.g ()))
(SC.expand_and_eval_set ~dir lib.cxx_flags ~standard:(Context.cc_g ctx))
requires
>>>
Build.run ~context:ctx