]> https://gitweb.dealii.org/ - dealii.git/commitdiff
respect nvcc flags 4846/head
authorMatthias Maier <tamiko@43-1.org>
Tue, 15 Aug 2017 21:42:49 +0000 (23:42 +0200)
committerMatthias Maier <tamiko@43-1.org>
Tue, 15 Aug 2017 21:44:03 +0000 (16:44 -0500)
cmake/setup_cached_variables.cmake

index b92d67d4d693901c5483a2d83f9226fa45571737..02a1c746c20bf515072b8ebf70828f4187822808 100644 (file)
@@ -223,6 +223,7 @@ SET(DEAL_II_REMOVED_FLAGS
   CMAKE_Fortran_FLAGS_DEBUG
   CMAKE_Fortran_FLAGS_MINSIZEREL
   CMAKE_Fortran_FLAGS_RELWITHDEBINFO
+  CUDA_NVCC_FLAGS
   CMAKE_CUDA_FLAGS
   CMAKE_CUDA_FLAGS_RELEASE
   CMAKE_CUDA_FLAGS_DEBUG
@@ -302,6 +303,15 @@ FOREACH(_flag LINKER_FLAGS LINKER_FLAGS_DEBUG LINKER_FLAGS_RELEASE)
   ENDIF()
 ENDFOREACH()
 
+IF(NOT "${CUDA_NVCC_FLAGS}}" STREQUAL "")
+  MESSAGE(STATUS
+    "Prepending \${CUDA_NVCC_FLAGS} to \${DEAL_II_CUDA_FLAGS}"
+    )
+  SET(DEAL_II_CUDA_FLAGS "${CUDA_NVCC_FLAGS} ${DEAL_II_CUDA_FLAGS}")
+ENDIF()
+
+
+
 #
 # Store user supplied flags in ${_flag}_SAVED and clear configuration
 # variables.
@@ -330,8 +340,8 @@ FOREACH(_flag ${DEAL_II_REMOVED_FLAGS})
 ENDFOREACH()
 
 #
-# Finally, read in CXXFLAGS and LDFLAGS from environment and prepend them
-# to the saved variables:
+# Finally, read in CXXFLAGS, LDFLAGS and NVCCFLAGS from environment and
+# prepend them to the saved variables:
 #
 # Also strip leading and trailing whitespace from linker flags to make
 # old cmake versions happy
@@ -341,8 +351,11 @@ SET(DEAL_II_CXX_FLAGS_SAVED "$ENV{CXXFLAGS} ${DEAL_II_CXX_FLAGS_SAVED}")
 STRING(STRIP "${DEAL_II_CXX_FLAGS_SAVED}" DEAL_II_CXX_FLAGS_SAVED)
 SET(DEAL_II_LINKER_FLAGS_SAVED "$ENV{LDFLAGS} ${DEAL_II_LINKER_FLAGS_SAVED}")
 STRING(STRIP "${DEAL_II_LINKER_FLAGS_SAVED}" DEAL_II_LINKER_FLAGS_SAVED)
+SET(DEAL_II_CUDA_FLAGS_SAVED "$ENV{NVCCFLAGS} ${DEAL_II_CUDA_FLAGS_SAVED}")
+STRING(STRIP "${DEAL_II_CUDA_FLAGS_SAVED}" DEAL_II_CUDA_FLAGS_SAVED)
 UNSET(ENV{CXXFLAGS})
 UNSET(ENV{LDFLAGS})
+UNSET(ENV{NVCCFLAGS})
 
 
 ########################################################################

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.