Skip to content

Commit

Permalink
[swift] autoconf support
Browse files Browse the repository at this point in the history
Summary: Allow disabling swift and provide variable SWIFTC for makefile use.

Reviewed By: geralt-encore

Differential Revision: D68548690

fbshipit-source-id: 25372c2b6f663d765b7d187482400e34bb2f1215
  • Loading branch information
ngorogiannis authored and facebook-github-bot committed Jan 23, 2025
1 parent c1fbf0d commit 1199bef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile.autoconf.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ REALPATH := @REALPATH@
REBAR3 := @REBAR3@
SDKROOT := @SDKROOT@
SHASUM := @SHASUM@
SWIFTC := @SWIFTC@
USER_JAVA_HOME := @USER_JAVA_HOME@
UTOP := @UTOP@
WINDOWS_BUILD := @WINDOWS_BUILD@
Expand Down
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ AC_ARG_ENABLE(python-analyzers,
BUILD_PYTHON_ANALYZERS=$enable_python_analyzers
AC_SUBST([BUILD_PYTHON_ANALYZERS])

AC_ARG_ENABLE(swift-analyzers,
AS_HELP_STRING([--disable-swift-analyzers],
[do not build the Swift analyzers (default is to build them)]),
,
enable_swift_analyzers=yes)
BUILD_SWIFT_ANALYZERS=$enable_swift_analyzers
AC_SUBST([BUILD_SWIFT_ANALYZERS])

AC_ARG_WITH(fcp-clang,
AS_HELP_STRING([--with-fcp-clang],
[use $CLANG_PREFIX/bin/clang to override the default compiler (default is not to override)]),
Expand Down Expand Up @@ -348,6 +356,10 @@ AS_IF([$HACKC --version >/dev/null 2>/dev/null],
[HACKC=no
AC_MSG_RESULT([no])])

if test "x$enable_swift_analyzers" = "xyes"; then
AC_CHECK_TOOL([SWIFTC], [swiftc], [no])
fi

if test "x$enable_java_analyzers" = "xyes"; then
AC_CHECK_TOOL([JAVA], [java], [no])
AC_CHECK_TOOL([JAVAC], [javac], [no])
Expand Down Expand Up @@ -420,6 +432,7 @@ ENABLE_OCAML_BINANNOT=$enable_ocaml_bin_annot
AC_SUBST([ENABLE_OCAML_BINANNOT])



# We use Buck to run the Infer tests
AS_IF([test x"$is_facebook_tree" = x"yes"],
AC_MSG_CHECKING([which .buckjavaversion to use])
Expand Down
2 changes: 1 addition & 1 deletion infer/src/base/Version.ml.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ let python_exe = "@PYTHON@"

let python_enabled = is_yes "@BUILD_PYTHON_ANALYZERS@"

let swift_enabled = is_yes "yes"
let swift_enabled = is_yes "@BUILD_SWIFT_ANALYZERS@"

0 comments on commit 1199bef

Please sign in to comment.