From 4eaab600cff7be5bcd9ea66c5b115bbc6f39bdf6 Mon Sep 17 00:00:00 2001 From: Artur Wojcik Date: Thu, 31 Aug 2023 23:41:11 +0200 Subject: [PATCH] cmake: use imported target for threads library instead of variable --- CMakeLists.txt | 1 + driver/CMakeLists.txt | 5 +---- src/CMakeLists.txt | 2 +- test/CMakeLists.txt | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d95378708..31a5e29538 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,7 @@ project ( MIOpen C CXX ) enable_testing() +find_package(Threads REQUIRED) find_package(ROCM 0.7.3 REQUIRED PATHS /opt/rocm) include(ROCMInstallTargets) diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt index 2918a5aa94..8aeae9c078 100644 --- a/driver/CMakeLists.txt +++ b/driver/CMakeLists.txt @@ -25,11 +25,8 @@ ################################################################################ cmake_minimum_required( VERSION 3.5) -find_package(Threads REQUIRED) - add_executable(MIOpenDriver main.cpp InputFlags.cpp) -target_link_libraries(MIOpenDriver MIOpen) -target_link_libraries(MIOpenDriver ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(MIOpenDriver MIOpen Threads::Threads) if(NOT MIOPEN_EMBED_DB STREQUAL "") target_link_libraries(MIOpenDriver $ ) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0bc457b93..05f38bf8f4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -692,7 +692,7 @@ target_include_directories(MIOpen SYSTEM PUBLIC $