Disable rtti / exceptions on the non-Windows builds.

RTTI makes the binaries bigger, exceptions make life harder for
optimisers.  Neither are actually used.

This doesn't preclude anything #including snmalloc.h with RTTI enabled,
it just disables it in the shim libraries and tests.

The FreeBSD libc builds were already doing this with no ill effect.
This commit is contained in:
David Chisnall
2019-02-06 17:36:49 +00:00
committed by David Chisnall
parent 2cd84c80b2
commit ccd8ec9b4f

View File

@@ -37,7 +37,7 @@ if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
else()
find_package(Threads REQUIRED)
add_compile_options(-mcx16 -march=native -Wall -Wextra -Werror -Wsign-conversion -g)
add_compile_options(-mcx16 -march=native -Wall -Wextra -Werror -Wsign-conversion -g -fno-exceptions -fno-rtti)
endif()
set(CMAKE_CXX_STANDARD 17)