[cmake-developers] Patch: FindCUDA.cmake -Wall Warnings

Robert Maynard robert.maynard at kitware.com
Mon Mar 30 10:31:41 EDT 2015


I know in the past setting all of NVidia's headers to be system includes
would actually break compilation of complex projects such as Thrust.

The reason for this was that in the past you would get the following error:
"error: kernel launches from templates are not allowed in system files"

On Mon, Mar 30, 2015 at 10:05 AM, Brad King <brad.king at kitware.com> wrote:

> On 03/28/2015 09:34 PM, Michael Tanner wrote:
> > using the CMAKE_INCLUDE_SYSTEM_FLAG_C flag to treat NVIDIA's
> > include files as system headers.
>
> Good idea.
>
> > -  set(CUDA_NVCC_INCLUDE_ARGS ${CUDA_NVCC_INCLUDE_ARGS_USER}
> "-I${CUDA_INCLUDE_DIRS}")
> > +  string(STRIP ${CMAKE_INCLUDE_SYSTEM_FLAG_C}
> CMAKE_INCLUDE_SYSTEM_FLAG_C_STRIPPED)
> > +  set(CUDA_NVCC_INCLUDE_ARGS ${CUDA_NVCC_INCLUDE_ARGS_USER}
> ${CMAKE_INCLUDE_SYSTEM_FLAG_C_STRIPPED} ${CUDA_INCLUDE_DIRS})
>
> I don't think CMAKE_INCLUDE_SYSTEM_FLAG_C is the proper flag:
>
> - It may not be set if C is not enabled
> - It may not be set if the current compiler has no such flag
> - It specifies a flag for the current "real" compiler, not for nvcc
>
> Does nvcc support -isystem on all platforms such that we could
> just hard-code using the flag?
>
> Thanks,
> -Brad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150330/73ca8fcf/attachment-0001.html>


More information about the cmake-developers mailing list