-
Notifications
You must be signed in to change notification settings - Fork 151
Closed
Labels
Description
There are a few compilation flags that make a huge difference with respect to unnecessary bloat in the resulting binaries when compiling stuff using pybind11. In particular, that is -fvisibility=hidden on GCC/Clang (>50% difference).
It's also good to turn on C++14 support if possible, since that pushes some precomputation to the compile phase. In CMake, I would just do:
if (HAS_CPP14_FLAG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
elseif (HAS_CPP11_FLAG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
message(FATAL_ERROR "Unsupported compiler -- at least C++11 support is needed!")
endif()
Is it possible to enable these flags here as well?