diff --git a/test/Common/CMakeLists.txt b/test/Common/CMakeLists.txt
index 75f3443caf48674c4c0efcb4c181806b50670ebd..7e8a146331c7dd935630bb43ba70de616ab0f4df 100644
--- a/test/Common/CMakeLists.txt
+++ b/test/Common/CMakeLists.txt
@@ -2,5 +2,8 @@ foreach(component Record UnitTest)
   add_library(${component} OBJECT)
   target_sources(${component} PRIVATE ${component}.cc)
   target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})
-  target_link_libraries(${component} PUBLIC cudawrappers::cu pmt)
+  target_link_libraries(${component} PUBLIC cudawrappers::cu)
+  if(BUILD_WITH_PMT)
+    target_link_libraries(${component} PRIVATE pmt)
+  endif()
 endforeach()