Skip to content

Commit

Permalink
Add -frtti for tests that use mocking
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dneto0 committed Dec 1, 2015
1 parent 15aebef commit bdc50b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ if (NOT ${SPIRV_SKIP_EXECUTABLES})

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

0 comments on commit bdc50b5

Please sign in to comment.