diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e5a8d0e81..e4bab6340f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,11 +290,18 @@ if(WIN32) SPIRV-Tools-opt PROPERTIES IMPORTED_LOCATION "${SPIRV_TOOLS_OPT_LIB}" IMPORTED_LOCATION_DEBUG "${SPIRV_TOOLS_OPT_DLIB}") endif() +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + find_library(LIBRT rt) +endif() + if(WIN32) set(SPIRV_TOOLS_LIBRARIES SPIRV-Tools-opt SPIRV-Tools) set(GLSLANG_LIBRARIES glslang OGLCompiler OSDependent HLSL SPIRV SPVRemapper ${SPIRV_TOOLS_LIBRARIES}) else() - set(SPIRV_TOOLS_LIBRARIES ${SPIRV_TOOLS_OPT_LIB} ${SPIRV_TOOLS_LIB}) + set(SPIRV_TOOLS_LIBRARIES + ${SPIRV_TOOLS_OPT_LIB} + ${SPIRV_TOOLS_LIB} + ${LIBRT}) set(GLSLANG_LIBRARIES ${GLSLANG_LIB} ${OGLCompiler_LIB} diff --git a/Sample-Programs/Hologram/CMakeLists.txt b/Sample-Programs/Hologram/CMakeLists.txt index cc041a4287..dcf291b738 100644 --- a/Sample-Programs/Hologram/CMakeLists.txt +++ b/Sample-Programs/Hologram/CMakeLists.txt @@ -96,6 +96,9 @@ endif() add_executable(Hologram ${sources}) target_compile_definitions(Hologram ${definitions}) target_include_directories(Hologram ${includes}) -target_link_libraries(Hologram ${libraries}) +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + find_library(LIBRT rt) +endif() +target_link_libraries(Hologram ${libraries} ${LIBRT}) install(TARGETS Hologram RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})