diff --git a/CMakeLists.txt b/CMakeLists.txt index 1434651ce..cc9c4fc42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ if( CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" ) string(REGEX MATCH "[A-Za-z]+" CXX_VERSION_STRING ${TMP_CXX_VERSION}) endif() -if( CXX_VERSION_STRING MATCHES "clang" ) +if( CMAKE_CXX_COMPILER_ID MATCHES "Clang") message( STATUS "Use hip-clang to build for amdgpu backend" ) # set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fallow-half-arguments-and-returns" ) set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__HIP_HCC_COMPAT_MODE__=1" ) diff --git a/clients/benchmarks/CMakeLists.txt b/clients/benchmarks/CMakeLists.txt index a21cd989c..5f78cddc0 100644 --- a/clients/benchmarks/CMakeLists.txt +++ b/clients/benchmarks/CMakeLists.txt @@ -68,7 +68,7 @@ else( ) target_link_libraries( rocblas-bench PRIVATE hip::host hip::device ) endif( ) -if( CMAKE_COMPILER_IS_GNUCXX OR CXX_VERSION_STRING MATCHES "clang") +if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") # GCC or hip-clang needs specific flags to turn on f16c intrinsics target_compile_options( rocblas-bench PRIVATE -mf16c ) endif( ) diff --git a/clients/gtest/CMakeLists.txt b/clients/gtest/CMakeLists.txt index be967699c..301b1ffc6 100644 --- a/clients/gtest/CMakeLists.txt +++ b/clients/gtest/CMakeLists.txt @@ -159,7 +159,7 @@ add_custom_target( rocblas-test-data add_dependencies( rocblas-test rocblas-test-data rocblas-common ) -if( CMAKE_COMPILER_IS_GNUCXX OR CXX_VERSION_STRING MATCHES "clang" ) +if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") # GCC or hip-clang needs specific flag to turn on f16c intrinsics target_compile_options( rocblas-test PRIVATE -mf16c ) endif( ) diff --git a/clients/samples/CMakeLists.txt b/clients/samples/CMakeLists.txt index 27b76bbd3..02a746365 100644 --- a/clients/samples/CMakeLists.txt +++ b/clients/samples/CMakeLists.txt @@ -70,7 +70,7 @@ foreach( exe ${sample_list_all} ) #target_compile_definitions( ${exe} PRIVATE __HIP_PLATFORM_HCC__ ) endif( ) - if( CMAKE_COMPILER_IS_GNUCXX OR CXX_VERSION_STRING MATCHES "clang" ) + if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") # GCC or hip-clang needs specific flags to turn on f16c intrinsics target_compile_options( ${exe} PRIVATE -mf16c ) endif( ) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index d8b8f68c5..846a1e13d 100755 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -1,5 +1,5 @@ # ######################################################################## -# Copyright 2016-2020 Advanced Micro Devices, Inc. +# Copyright 2016-2021 Advanced Micro Devices, Inc. # ######################################################################## # The following helper functions wrap common cmake functions. They are @@ -154,7 +154,7 @@ endif( ) set( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "\${CPACK_PACKAGING_INSTALL_PREFIX}" "\${CPACK_PACKAGING_INSTALL_PREFIX}/include" "\${CPACK_PACKAGING_INSTALL_PREFIX}/lib" ) # Give rocblas compiled for CUDA backend a different name -if( CXX_VERSION_STRING MATCHES "clang" ) +if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) set( package_name rocblas ) else( ) set( package_name rocblas-alt )