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

Brad King brad.king at kitware.com
Mon Mar 30 10:05:20 EDT 2015


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



More information about the cmake-developers mailing list