From: David Neto Date: Tue, 1 Dec 2015 15:01:33 +0000 (-0500) Subject: Add -frtti for tests that use mocking X-Git-Tag: upstream/2018.6~1413 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdc50b5d6239a7709b855312d644529dc273fb70;p=platform%2Fupstream%2FSPIRV-Tools.git Add -frtti for tests that use mocking The tests now use mocked methods. This requires runtime type information for those test classes. https://github.com/google/googletest/issues/610 This has been fixed recently upstream in googletest. Until we pick up that fix, add -frtti for the the test executable only. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6826b98..65c4ef5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)