Summary: Using the same trick as for the java frontend: define a dune library that takes either all the modules in the directory (except possibly stubs) or none of the modules (except possible stubs). In order to break the circular dependency between al/ and clang/, introduce a dirty callback in clang/. Reviewed By: dulmarod Differential Revision: D21440823 fbshipit-source-id: ac6b40b4emaster
parent
c661baffe7
commit
6e68448e3b
@ -0,0 +1,31 @@
|
||||
(* -*- tuareg -*- *)
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
(* NOTE: prepend dune.common to this file! *)
|
||||
|
||||
let al =
|
||||
Printf.sprintf
|
||||
{|(ocamllex types_lexer ctl_lexer)
|
||||
|
||||
(menhir (modules types_parser ctl_parser))
|
||||
|
||||
(library
|
||||
(name ASTLanguage)
|
||||
(public_name infer.ASTLanguage)
|
||||
(modules %s)
|
||||
(flags
|
||||
(:standard
|
||||
-open Core -open InferStdlib -open IStd -open OpenSource -open InferGenerated
|
||||
-open InferBase -open InferIR -open Absint -open ClangFrontend))
|
||||
(libraries core InferStdlib InferGenerated InferBase InferIR absint ClangFrontend)
|
||||
(preprocess (pps ppx_compare))
|
||||
)|}
|
||||
(if clang then ":standard" else "")
|
||||
|
||||
|
||||
;;
|
||||
Jbuild_plugin.V1.send al
|
@ -0,0 +1,31 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
let die () =
|
||||
prerr_endline "ERROR: infer was built without clang support." ;
|
||||
Die.exit 1
|
||||
|
||||
|
||||
module ClangQuotes = struct
|
||||
type style = EscapedDoubleQuotes | SingleQuotes | EscapedNoQuotes
|
||||
|
||||
let mk_arg_file _ _ _ = die ()
|
||||
end
|
||||
|
||||
module ClangWrapper = struct
|
||||
let exe ~prog:_ ~args:_ = ()
|
||||
end
|
||||
|
||||
module CTLParserHelper = struct
|
||||
let validate_al_files () = die ()
|
||||
end
|
||||
|
||||
module RegisterCallback = struct
|
||||
let register_frontend_checks () = ()
|
||||
end
|
@ -0,0 +1,31 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
(** ****DO NOT USE DIRECTLY****
|
||||
|
||||
This module is automatically [open]'d by the build system when compiling infer without clang
|
||||
support. The stubs implemented here do nothing. *)
|
||||
|
||||
module ClangQuotes : sig
|
||||
type style = EscapedDoubleQuotes | SingleQuotes | EscapedNoQuotes
|
||||
|
||||
val mk_arg_file : string -> style -> string list -> string
|
||||
end
|
||||
|
||||
module ClangWrapper : sig
|
||||
val exe : prog:string -> args:string list -> unit
|
||||
end
|
||||
|
||||
module CTLParserHelper : sig
|
||||
val validate_al_files : unit -> (unit, string) Result.t
|
||||
end
|
||||
|
||||
module RegisterCallback : sig
|
||||
val register_frontend_checks : unit -> unit
|
||||
end
|
@ -0,0 +1,27 @@
|
||||
(* -*- tuareg -*- *)
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
(* NOTE: prepend dune.common to this file! *)
|
||||
|
||||
let clang =
|
||||
Printf.sprintf
|
||||
{|(library
|
||||
(name ClangFrontend)
|
||||
(public_name infer.ClangFrontend)
|
||||
(modules %s)
|
||||
(flags
|
||||
(:standard
|
||||
-open Core -open InferStdlib -open IStd -open OpenSource -open InferGenerated
|
||||
-open InferBase -open InferIR -open Absint -open Checkers -open TestDeterminators))
|
||||
(libraries core InferStdlib InferGenerated InferBase InferIR absint checkers TestDeterminators)
|
||||
(preprocess (pps ppx_compare))
|
||||
)|}
|
||||
(if clang then ":standard \\ ClangFrontendStubs" else "ClangFrontendStubs")
|
||||
|
||||
|
||||
;;
|
||||
Jbuild_plugin.V1.send clang
|
@ -1,10 +0,0 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
let exe ~prog:_ ~args:_ = ()
|
@ -1,10 +0,0 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
val exe : prog:string -> args:string list -> unit
|
@ -0,0 +1,15 @@
|
||||
; Copyright (c) Facebook, Inc. and its affiliates.
|
||||
;
|
||||
; This source code is licensed under the MIT license found in the
|
||||
; LICENSE file in the root directory of this source tree.
|
||||
|
||||
(library
|
||||
(name TestDeterminators)
|
||||
(public_name infer.TestDeterminators)
|
||||
(flags
|
||||
(:standard
|
||||
-open Core -open InferStdlib -open IStd -open OpenSource -open InferGenerated
|
||||
-open InferBase -open InferIR -open InferCStubs))
|
||||
(libraries core InferStdlib InferGenerated InferBase InferIR InferCStubs)
|
||||
(preprocess (pps ppx_compare))
|
||||
)
|
Loading…
Reference in new issue