Fixed undefined reference to 'clock_gettime' by linking rt library (#2409)

This commit is contained in:
François Bertel 2019-02-25 08:57:34 -05:00 committed by Steven Perron
parent a006cbc1d0
commit 37b584a736

View File

@ -361,6 +361,14 @@ target_compile_definitions(${SPIRV_TOOLS}-shared
)
add_dependencies( ${SPIRV_TOOLS}-shared core_tables enum_string_mapping extinst_tables )
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
find_library(LIBRT rt)
if(LIBRT)
target_link_libraries(${SPIRV_TOOLS} ${LIBRT})
target_link_libraries(${SPIRV_TOOLS}-shared ${LIBRT})
endif()
endif()
if(ENABLE_SPIRV_TOOLS_INSTALL)
install(TARGETS ${SPIRV_TOOLS} ${SPIRV_TOOLS}-shared
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}