[sledge] Name the sledge library `sledge`

Summary:
If both the library and binary are named `sledge`, then compilation
works fine and resolves the names correctly, but merlin gets confused
and cannot find the sledge library modules used in the bin sources. So
the binary and library need different names. The name of the library
gets exposed to clients, while the name of the binary only determines
the name of some files in the _build directory, which can be renamed
as desired. Therefore, use the `sledge` name for the library module,
and rename the binary module to `sledge_cli`, but still have dune
install it as `sledge.exe`.

Reviewed By: jvillard

Differential Revision: D20589431

fbshipit-source-id: 14b65907d
master
Josh Berdine 5 years ago committed by Facebook GitHub Bot
parent ed82bca4a5
commit 461f88756d

@ -6,7 +6,7 @@
.PHONY: default .PHONY: default
default: exes default: exes
EXES = bin/sledge EXES = bin/sledge_cli
INSTALLS = sledge INSTALLS = sledge
DBG_TARGETS = $(patsubst %,_build/dbg/%.exe,$(EXES)) $(patsubst %,_build/dbg/%.install,$(INSTALLS)) DBG_TARGETS = $(patsubst %,_build/dbg/%.exe,$(EXES)) $(patsubst %,_build/dbg/%.install,$(INSTALLS))
@ -67,7 +67,7 @@ clean:
.PHONY: fmt .PHONY: fmt
fmt: fmt:
dune build @_build/dbg/fmt --auto-promote 2>/dev/null -dune build @_build/dbg/fmt --auto-promote 2>/dev/null
clang-format -i model/llair_intrinsics.h model/cxxabi.cpp clang-format -i model/llair_intrinsics.h model/cxxabi.cpp
${MAKE} -C test fmt ${MAKE} -C test fmt

@ -4,12 +4,13 @@
; LICENSE file in the root directory of this source tree. ; LICENSE file in the root directory of this source tree.
(executable (executable
(name sledge_cli)
(public_name sledge) (public_name sledge)
(package sledge) (package sledge)
(libraries apron apron.boxMPQ ctypes ctypes.foreign dune-build-info llvm (libraries apron apron.boxMPQ ctypes ctypes.foreign dune-build-info llvm
llvm.irreader llvm.analysis llvm.scalar_opts llvm.target llvm.ipo llvm.irreader llvm.analysis llvm.scalar_opts llvm.target llvm.ipo
llvm.linker shexp.process yojson trace import sledgelib model) llvm.linker shexp.process yojson trace import sledge model)
(flags (flags
(:standard -open Import -open Sledgelib -open Model)) (:standard -open Import -open Sledge -open Model))
(preprocess (preprocess
(pps ppx_sledge))) (pps ppx_sledge)))

@ -30,7 +30,8 @@
(rule (rule
(targets sledge-help.txt) (targets sledge-help.txt)
(deps bin/sledge.ml bin/sledge_buck.ml tools/gen_help.sh bin/sledge.exe) (deps bin/sledge_cli.ml bin/sledge_buck.ml tools/gen_help.sh
bin/sledge_cli.exe)
(action (action
(with-stdout-to (with-stdout-to
sledge-help.txt sledge-help.txt

@ -4,7 +4,7 @@
; LICENSE file in the root directory of this source tree. ; LICENSE file in the root directory of this source tree.
(library (library
(name sledgelib) (name sledge)
(public_name sledge) (public_name sledge)
(libraries trace import) (libraries trace import)
(flags (flags

Loading…
Cancel
Save