You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
8 years ago
|
(* -*- tuareg -*- *)
|
||
|
(* use strings so that it looks like OCaml even before substituting, e.g. to use ocamlformat *)
|
||
|
|
||
|
let is_yes = String.equal "yes"
|
||
|
|
||
|
let clang = is_yes "@BUILD_C_ANALYZERS@"
|
||
|
|
||
|
let java = is_yes "@BUILD_JAVA_ANALYZERS@"
|
||
|
|
||
|
let facebook = is_yes "@IS_FACEBOOK_TREE@"
|
||
|
|
||
|
let extra_cflags = if "@EXTRA_CFLAGS" = "" then [] else ["@EXTRA_CFLAGS@"]
|
||
|
|
||
|
let common_cflags =
|
||
|
let fatal_warnings = "+3+5+6+8+10+11+12+18+19+20+21+23+26+29+27+32+33+34+35+37+38+39+50+52+57" in
|
||
|
let warnings = fatal_warnings ^ "-4-9-40-41-42-45-48" in
|
||
|
let common_flags =
|
||
|
[ "-g"
|
||
|
; "-short-paths"
|
||
|
; "-safe-string"
|
||
|
; "-principal"
|
||
|
; "-strict-formats"
|
||
|
; "-strict-sequence"
|
||
|
; "-bin-annot"
|
||
|
; "-w"
|
||
|
; warnings ]
|
||
|
in
|
||
|
match Jbuild_plugin.V1.context with
|
||
|
| "test"
|
||
|
-> "-warn-error" :: fatal_warnings :: common_flags
|
||
|
| "default"
|
||
|
-> common_flags
|
||
|
| ctx
|
||
|
-> invalid_arg ("unknown context: " ^ ctx)
|
||
|
|
||
|
let common_libraries =
|
||
|
(if java then ["javalib"; "ptrees"; "sawja"] else [])
|
||
|
@ [ "ANSITerminal"
|
||
|
; "atdgen"
|
||
|
; "cmdliner"
|
||
|
; "core"
|
||
|
; "extlib"
|
||
|
; "oUnit"
|
||
|
; "parmap"
|
||
|
; "str"
|
||
|
; "unix"
|
||
|
; "xmlm"
|
||
|
; "yojson"
|
||
|
; "zip" ]
|