diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a7baed97089..d3c128f14f42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,7 +174,7 @@ endif() if(USE_CUDA) find_package(CUDA 9.0 REQUIRED) include_directories(${CUDA_INCLUDE_DIRS}) - LIST(APPEND CMAKE_CUDA_FLAGS -Xcompiler=${OpenMP_CXX_FLAGS} -Xcompiler=-fPIC -Xcompiler=-Wall) + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=${OpenMP_CXX_FLAGS} -Xcompiler=-fPIC -Xcompiler=-Wall") set(CUDA_ARCHS "6.0" "6.1" "6.2" "7.0") if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") @@ -189,14 +189,14 @@ if(USE_CUDA) list(POP_BACK CUDA_ARCHS CUDA_LAST_SUPPORTED_ARCH) list(APPEND CUDA_ARCHS "${CUDA_LAST_SUPPORTED_ARCH}+PTX") CUDA_SELECT_NVCC_ARCH_FLAGS(CUDA_ARCH_FLAGS ${CUDA_ARCHS}) + string(REPLACE ";" " " CUDA_ARCH_FLAGS "${CUDA_ARCH_FLAGS}") - LIST(APPEND CMAKE_CUDA_FLAGS ${CUDA_ARCH_FLAGS}) + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${CUDA_ARCH_FLAGS}") if(USE_DEBUG) SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -g") else() SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -O3 -lineinfo") endif() - string(REPLACE ";" " " CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS}") message(STATUS "CMAKE_CUDA_FLAGS: ${CMAKE_CUDA_FLAGS}") ADD_DEFINITIONS(-DUSE_CUDA)