Skip to content
Snippets Groups Projects
Commit a573336f authored by Martin Bauer's avatar Martin Bauer
Browse files

CMake CUDA: workaround for nvcc's not using system includes

- nvcc also printed warnings in system libs like boost
parent a5f840b0
No related merge requests found
...@@ -1068,6 +1068,16 @@ if ( WALBERLA_BUILD_WITH_CUDA ) ...@@ -1068,6 +1068,16 @@ if ( WALBERLA_BUILD_WITH_CUDA )
list ( APPEND SERVICE_LIBS ${CUDA_LIBRARIES} ) list ( APPEND SERVICE_LIBS ${CUDA_LIBRARIES} )
list( APPEND CUDA_NVCC_FLAGS "-Wno-deprecated-gpu-targets") list( APPEND CUDA_NVCC_FLAGS "-Wno-deprecated-gpu-targets")
# FindCUDA does not respect system includes i.e. there are also warnings for boost etc reported (as of cmake 3.5.1)
# if all includes are added to the flags manually as sytem includes they occur double on the command line
# but the compiler seems to note the "isystem" not the "-I"
# it is also not possible to get all system include directories - so as a workaround we at least add boost here
# as system include
foreach( boostInclude ${Boost_INCLUDE_DIRS} )
list( APPEND CUDA_NVCC_FLAGS "-isystem ${boostInclude}" )
endforeach()
if ( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=" ) if ( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=" )
list ( APPEND CUDA_NVCC_FLAGS "-std=c++11" ) list ( APPEND CUDA_NVCC_FLAGS "-std=c++11" )
endif () endif ()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment