Browse files

added -keep option to cmake

  • Loading branch information...
1 parent 94dab38 commit c86ccb0bad28d478b3420e68f6871407c485c331 @harrism harrism committed Apr 27, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 runtime/CMakeLists.txt
View
11 runtime/CMakeLists.txt
@@ -36,6 +36,11 @@ option(COMPILE_SM30
"On to enable SM30 compilation"
ON
)
+
+option(CUDA_KEEP_INTERMEDIATE_FILES
+ "On to enable -keep"
+ OFF
+ )
FIND_PACKAGE(CUDA REQUIRED)
@@ -98,6 +103,10 @@ source_group("CUDA Source Files" FILES ${CUFILES} ${CUHFILES})
set(GENCODE_SM20 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_20,code=compute_20)
set(GENCODE_SM30 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_30,code=compute_30)
+if (CUDA_KEEP_INTERMEDIATE_FILES)
+ set(KEEP -keep)
+endif(CUDA_KEEP_INTERMEDIATE_FILES)
+
if (CUDA_VERBOSE_PTXAS)
set(VERBOSE_PTXAS --ptxas-options=-v)
endif (CUDA_VERBOSE_PTXAS)
@@ -158,7 +167,7 @@ cuda_add_executable(bonsai2
${CCFILES}
${HFILES}
${CUFILES}
- OPTIONS ${GENCODE} ${VERBOSE_PTXAS} ${DEVICE_DEBUGGING}
+ OPTIONS ${GENCODE} ${VERBOSE_PTXAS} ${DEVICE_DEBUGGING} ${KEEP}
)
target_link_libraries(bonsai2 ${ALL_LIBRARIES})

0 comments on commit c86ccb0

Please sign in to comment.