build: disable rtti for release builds

This commit is contained in:
Danny Robson 2015-10-08 12:20:56 +11:00
parent 98ef67fa8d
commit 0283c6b0f9
2 changed files with 7 additions and 0 deletions

View File

@ -61,6 +61,8 @@ AC_DEFUN([NC_DEBUGGING],[
NC_APPEND_ONE_COMPILE_FLAG([-O0])
], [
AX_APPEND_COMPILE_FLAGS([-O2])
AX_APPEND_COMPILE_FLAGS([-fno-rtti])
AC_DEFINE([NO_RTTI], [], [RTTI disabled])
])
##-------------------------------------------------------------------------

View File

@ -26,6 +26,7 @@ main ()
}
{
#if !defined(NO_RTTI)
auto tuple = std::make_tuple (1u, 1, 1.f, 1.);
std::vector<std::type_index> expected {
std::type_index (typeid (1u)),
@ -40,8 +41,12 @@ main ()
});
tap.expect_eq (actual, expected, "type iteration");
#else
tap.skip ("type iteration");
#endif
}
{
using src_t = std::tuple<std::string>;
using dst_t = typename util::tuple::map<src_t, int_mapper>::type;