From 982100abc72d435a48d059bd777534764b99ee4c Mon Sep 17 00:00:00 2001 From: 6clc Date: Mon, 14 Aug 2023 12:42:32 +0800 Subject: [PATCH] [CINN] Fix cinn compile (#56164) * [CINN] Fix compile error * delete useless env * fix gflags conflict * fix args used by ut --------- Co-authored-by: ZzSean <18818272991@163.com> --- cmake/cinn/core.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/cinn/core.cmake b/cmake/cinn/core.cmake index c54aea3cc29..dedefc57a69 100644 --- a/cmake/cinn/core.cmake +++ b/cmake/cinn/core.cmake @@ -151,8 +151,11 @@ function(cinn_nv_test TARGET_NAME) set(multiValueArgs SRCS DEPS ARGS) cmake_parse_arguments(cinn_nv_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - cuda_add_executable(${TARGET_NAME} ${cinn_nv_test_SRCS} OPTIONS - "-std=c++${CMAKE_CUDA_STANDARD}") + # Attention: + # 1. cuda_add_executable is deprecated after cmake v3.10, use cuda_add_executable for CUDA please. + # 2. cuda_add_executable does not support ccache. + # Reference: https://cmake.org/cmake/help/v3.10/module/FindCUDA.html + add_executable(${TARGET_NAME} ${cinn_nv_test_SRCS}) get_property(os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES) target_link_libraries( ${TARGET_NAME} @@ -165,7 +168,6 @@ function(cinn_nv_test TARGET_NAME) ${CUDA_LIBRARIES}) add_dependencies(${TARGET_NAME} ${cinn_nv_test_DEPS} cinn_gtest_main gtest) common_link(${TARGET_NAME}) - # add_test(${TARGET_NAME} ${TARGET_NAME}) add_test( NAME ${TARGET_NAME} COMMAND ${TARGET_NAME} "${cinn_nv_test_ARGS}" -- GitLab