You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing -DGTEST_HAS_RTTI=0 to cmake the value of GTEST_HAS_RTTI still ends being 1, which causes gtest to use typeid. This is obviously a problem when trying to use gtest with code that was compiled with -fno-rtti.
As a side-note, I ran into this problem when using gtest though vcpkg, so in order to define this preprocessor macro i had to add a patch to gtest's CMakeLists.txt and add add_definitions(-DGTEST_HAS_RTTI=0) because it does not support passing the options defined in gtest-port.h. Consider adding support for these options in the cmakelists file in the future so a patch is not needed and instead passing GTEST_HAS_RTTI=OFF to vcpkg_cmake_configure will be enough
Steps to reproduce the problem
try and link gtest compiled with -DGTEST_HAS_RTTI=0 into a binary compiled with -fno-rtti. The problem occurs when trying to use TYPED_TEST_SUITE()
What version of GoogleTest are you using?
1.14.0 through vcpkg
What operating system and version are you using?
ubuntu22.04
What compiler and version are you using?
gcc 13.2
What build system are you using?
cmake 3.28
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the issue
When passing -DGTEST_HAS_RTTI=0 to cmake the value of GTEST_HAS_RTTI still ends being 1, which causes gtest to use typeid. This is obviously a problem when trying to use gtest with code that was compiled with -fno-rtti.
As a side-note, I ran into this problem when using gtest though vcpkg, so in order to define this preprocessor macro i had to add a patch to gtest's CMakeLists.txt and add add_definitions(-DGTEST_HAS_RTTI=0) because it does not support passing the options defined in gtest-port.h. Consider adding support for these options in the cmakelists file in the future so a patch is not needed and instead passing GTEST_HAS_RTTI=OFF to vcpkg_cmake_configure will be enough
Steps to reproduce the problem
try and link gtest compiled with -DGTEST_HAS_RTTI=0 into a binary compiled with -fno-rtti. The problem occurs when trying to use TYPED_TEST_SUITE()
What version of GoogleTest are you using?
1.14.0 through vcpkg
What operating system and version are you using?
ubuntu22.04
What compiler and version are you using?
gcc 13.2
What build system are you using?
cmake 3.28
Additional context
No response
The text was updated successfully, but these errors were encountered: