diff --git a/CMakeLists.txt b/CMakeLists.txt index ec4bf1340..f7670a515 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -716,8 +716,7 @@ if (LLAMA_CUBLAS) list(APPEND CUDA_CXX_FLAGS ${ARCH_FLAGS}) list(JOIN CUDA_CXX_FLAGS " " CUDA_CXX_FLAGS_JOINED) # pass host compiler flags as a single argument if (NOT CUDA_CXX_FLAGS_JOINED STREQUAL "") - set(CUDA_FLAGS -Xcompiler ${CUDA_CXX_FLAGS_JOINED}) - add_compile_options("$<$:${CUDA_FLAGS}>") + list(APPEND CUDA_FLAGS -Xcompiler ${CUDA_CXX_FLAGS_JOINED}) endif() endif() add_compile_options("$<$:${CUDA_FLAGS}>")