Skip to content

Commit bdc50b5

Browse files
committed
Add -frtti for tests that use mocking
The tests now use mocked methods. This requires runtime type information for those test classes. google/googletest#610 This has been fixed recently upstream in googletest. Until we pick up that fix, add -frtti for the the test executable only.
1 parent 15aebef commit bdc50b5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ if (NOT ${SPIRV_SKIP_EXECUTABLES})
219219

220220
add_executable(UnitSPIRV ${TEST_SOURCES})
221221
default_compile_options(UnitSPIRV)
222+
if (UNIX)
223+
# The tests use mocking, and mocking requires runtime type information
224+
# for the test classes. Until we adopt a version of gmock that avoids
225+
# this problem (see https://github.com/google/googletest/issues/610),
226+
# add RTTI.
227+
target_compile_options(UnitSPIRV PRIVATE -frtti)
228+
endif()
222229
target_include_directories(UnitSPIRV PRIVATE
223230
${gmock_SOURCE_DIR}/include ${gtest_SOURCE_DIR}/include)
224231
target_link_libraries(UnitSPIRV PRIVATE ${SPIRV_TOOLS} gmock)

0 commit comments

Comments
 (0)