Skip to content

Commit

Permalink
toolchain-funcs.eclass: add tc-enables-cxx-assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
thesamesam committed Jan 30, 2023
1 parent f06cb39 commit 3ffccf8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions eclass/toolchain-funcs.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,15 @@ gcc-specs-stack-check() {
[[ "${directive/\{!fno-stack-check:}" != "${directive}" ]]
}

# @FUNCTION: tc-enables-cxx-assertions
# @RETURN: Truth if the current compiler enables assertions in the C++ standard library
# @DESCRIPTION:
# Return truth if the current compiler enables assertions in the C++ standard
# library. For libstdc++, this is -D_GLIBCXX_ASSERTIONS, and for libcxx/libc++,
# this is -D_LIBCPP_ENABLE_ASSERTIONS.
tc-enables-cxx-assertions() {
tc-cpp-is-true "defined(_GLIBCXX_ASSERTIONS) || defined(_LIBCPP_ENABLE_ASSERTIONS)" ${CPPFLAGS} ${CXXFLAGS}
}

# @FUNCTION: tc-enables-pie
# @RETURN: Truth if the current compiler generates position-independent code (PIC) which can be linked into executables
Expand Down

0 comments on commit 3ffccf8

Please sign in to comment.