Skip to content

Commit

Permalink
cmake: use HIP CONFIG on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
evetsso authored Sep 1, 2021
1 parent 894ea5c commit 41491c9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
6 changes: 5 additions & 1 deletion clients/rider/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ target_include_directories( hipfft-rider

if( NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
find_package( HIP REQUIRED )
if( WIN32 )
find_package( HIP CONFIG REQUIRED )
else()
find_package( HIP MODULE REQUIRED )
endif()
target_link_libraries( hipfft-rider PRIVATE hip::host )
else()

Expand Down
6 changes: 5 additions & 1 deletion clients/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ foreach( sample ${sample_list} )
target_link_libraries( ${sample} PRIVATE hip::hipfft )

if( NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
find_package( HIP MODULE REQUIRED )
if( WIN32 )
find_package( HIP CONFIG REQUIRED )
else()
find_package( HIP MODULE REQUIRED )
endif()
if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
target_link_libraries( ${sample} PRIVATE hip::host )
else()
Expand Down
6 changes: 5 additions & 1 deletion clients/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ endif()

if( NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
find_package( HIP MODULE REQUIRED )
if( WIN32 )
find_package( HIP CONFIG REQUIRED )
else()
find_package( HIP MODULE REQUIRED )
endif()
target_link_libraries( hipfft-test PRIVATE hip::host )
else()
target_compile_definitions( hipfft-test PRIVATE __HIP_PLATFORM_NVIDIA__)
Expand Down
12 changes: 10 additions & 2 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,22 @@ find_package(Git REQUIRED)
# HIP
if( NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
find_package( HIP REQUIRED )
if( WIN32 )
find_package( HIP CONFIG REQUIRED )
else()
find_package( HIP MODULE REQUIRED )
endif()
list( APPEND HIP_INCLUDE_DIRS "${HIP_ROOT_DIR}/include" )
endif()
else()
if( BUILD_WITH_LIB STREQUAL "CUDA" )
set(HIP_INCLUDE_DIRS "${HIP_ROOT_DIR}/include")
else()
find_package( HIP REQUIRED )
if( WIN32 )
find_package( HIP CONFIG REQUIRED )
else()
find_package( HIP MODULE REQUIRED )
endif()
endif()
endif()

Expand Down

0 comments on commit 41491c9

Please sign in to comment.