]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Properly propagate all compiler flags to the cuda wrapper
authorMatthias Maier <tamiko@43-1.org>
Thu, 12 Jan 2017 16:54:39 +0000 (10:54 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 13 Jan 2017 09:34:45 +0000 (03:34 -0600)
cmake/configure/configure_1_cuda.cmake
cmake/macros/macro_deal_ii_add_library.cmake

index e14fa2c6164b126d711ba67516d9daf449f1bd85..aec9028c97d44ba179d59db0f420cc5fed314d58 100644 (file)
@@ -96,11 +96,6 @@ MACRO(FEATURE_CUDA_FIND_EXTERNAL var)
       STRING(SUBSTRING "${CUDA_COMPUTE_CAPABILITY}" 1 1 CUDA_COMPUTE_CAPABILITY_MINOR)
       SET(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE FALSE)
 
-
-      SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -std=c++11)
-
-      # FIXME: CUDA compiler NVCC doesn't support C++14.
-
     ENDIF()
   ENDIF()
 
index 0fc796796d8134aba4d1d673c27dbd33c76a4be4..5a4c900cdf1e925d9b0669771667db00d1020ff0 100644 (file)
@@ -62,9 +62,19 @@ MACRO(DEAL_II_ADD_LIBRARY _library)
     # Cuda specific target setup:
     #
     IF(DEAL_II_WITH_CUDA)
+
+      #
+      # CUDA_WRAP_SRCS does not automatically pick up host compiler flags
+      # from the target, so we have to feed relevant flags ourselves
+      #
+      SET(CMAKE_CXX_FLAGS
+        "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}"
+        )
+
       CUDA_WRAP_SRCS(${_library}_${_build_lowercase}
         OBJ _generated_cuda_files ${ARGN} SHARED
         )
+      SET(CMAKE_CXX_FLAGS "")
 
       ADD_CUSTOM_TARGET(${_library}_${_build_lowercase}_cuda
         DEPENDS

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.