summaryrefslogtreecommitdiff
path: root/utils/ccomp.ml
diff options
context:
space:
mode:
authorSébastien Hinderer <Sebastien.Hinderer@inria.fr>2017-03-16 10:21:00 +0100
committerSébastien Hinderer <Sebastien.Hinderer@inria.fr>2017-03-29 11:10:06 +0200
commitf2d5d60376096c241fb0e9679f933750e5401cee (patch)
tree57f1dff35cd2ec635c84a8c86d6d8cfc66fec726 /utils/ccomp.ml
parent3262da1839af92b076c84e8a65636650f38dcd09 (diff)
downloadocaml-f2d5d60376096c241fb0e9679f933750e5401cee.tar.gz
Define new build variables for C compiler and preprocessor flags
Diffstat (limited to 'utils/ccomp.ml')
-rw-r--r--utils/ccomp.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/utils/ccomp.ml b/utils/ccomp.ml
index 30115b0be1..fb480bb336 100644
--- a/utils/ccomp.ml
+++ b/utils/ccomp.ml
@@ -82,9 +82,11 @@ let compile_file name =
(match !Clflags.c_compiler with
| Some cc -> cc
| None ->
- if !Clflags.native_code
- then Config.native_c_compiler
- else Config.bytecomp_c_compiler)
+ let (cflags, cppflags) =
+ if !Clflags.native_code
+ then (Config.ocamlopt_cflags, Config.ocamlopt_cppflags)
+ else (Config.ocamlc_cflags, Config.ocamlc_cppflags) in
+ (String.concat " " [Config.c_compiler; cflags; cppflags]))
(if !Clflags.debug && Config.ccomp_type <> "msvc" then "-g" else "")
(String.concat " " (List.rev !Clflags.all_ccopts))
(quote_prefixed "-I" (List.rev !Clflags.include_dirs))