Skip to content

Commit

Permalink
dev-ml/llvm-ocaml: Fix passing NDEBUG to build for LLVMDumpType()
Browse files Browse the repository at this point in the history
Add USE=debug that controls -DNDEBUG since upstream started defining
dump functions conditionally to debug being enabled. We therefore need
to disable dumps in OCaml bindings if LLVM was built without them.
  • Loading branch information
mgorny committed Jul 29, 2017
1 parent ea2edc2 commit ee3556f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions dev-ml/llvm-ocaml/llvm-ocaml-5.0.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
LICENSE="UoI-NCSA"
SLOT="0/${PV}"
KEYWORDS=""
IUSE="test ${ALL_LLVM_TARGETS[*]}"
IUSE="debug test ${ALL_LLVM_TARGETS[*]}"

RDEPEND="
>=dev-lang/ocaml-4.00.0:0=
dev-ml/ocaml-ctypes:=
~sys-devel/llvm-${PV}:=[${LLVM_TARGET_USEDEPS// /,}]
~sys-devel/llvm-${PV}:=[${LLVM_TARGET_USEDEPS// /,},debug?]
!sys-devel/llvm[ocaml(-)]"
# configparser-3.2 breaks the build (3.3 or none at all are fine)
DEPEND="${RDEPEND}
Expand Down Expand Up @@ -81,7 +81,7 @@ src_configure() {
-DLLVM_ENABLE_TERMINFO=OFF
-DHAVE_HISTEDIT_H=NO
-DWITH_POLLY=OFF
-DLLVM_ENABLE_ASSERTIONS=OFF
-DLLVM_ENABLE_ASSERTIONS=$(usex debug)
-DLLVM_ENABLE_EH=ON
-DLLVM_ENABLE_RTTI=ON

Expand All @@ -97,6 +97,9 @@ src_configure() {
-DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
)

# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
# also: custom rules for OCaml do not work for CPPFLAGS
use debug || local -x CFLAGS="${CFLAGS} -DNDEBUG"
cmake-utils_src_configure

local llvm_libdir=$(llvm-config --libdir)
Expand Down
9 changes: 6 additions & 3 deletions dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
LICENSE="UoI-NCSA"
SLOT="0/${PV}"
KEYWORDS=""
IUSE="test ${ALL_LLVM_TARGETS[*]}"
IUSE="debug test ${ALL_LLVM_TARGETS[*]}"

RDEPEND="
>=dev-lang/ocaml-4.00.0:0=
dev-ml/ocaml-ctypes:=
~sys-devel/llvm-${PV}:=[${LLVM_TARGET_USEDEPS// /,}]
~sys-devel/llvm-${PV}:=[${LLVM_TARGET_USEDEPS// /,},debug?]
!sys-devel/llvm[ocaml(-)]"
# configparser-3.2 breaks the build (3.3 or none at all are fine)
DEPEND="${RDEPEND}
Expand Down Expand Up @@ -80,7 +80,7 @@ src_configure() {
-DLLVM_ENABLE_TERMINFO=OFF
-DHAVE_HISTEDIT_H=NO
-DWITH_POLLY=OFF
-DLLVM_ENABLE_ASSERTIONS=OFF
-DLLVM_ENABLE_ASSERTIONS=$(usex debug)
-DLLVM_ENABLE_EH=ON
-DLLVM_ENABLE_RTTI=ON

Expand All @@ -96,6 +96,9 @@ src_configure() {
-DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
)

# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
# also: custom rules for OCaml do not work for CPPFLAGS
use debug || local -x CFLAGS="${CFLAGS} -DNDEBUG"
cmake-utils_src_configure

local llvm_libdir=$(llvm-config --libdir)
Expand Down

0 comments on commit ee3556f

Please sign in to comment.