[CMake] FindCuda compiler flag problems

Wesley Smith wesley.hoke at gmail.com
Mon May 11 12:54:01 EDT 2015


Hi,
I'm trying to compile w/ CUDA on Centos6 using Cuda7 and C++11.  When
I have host propagate flags on, the CXX flags get mangles with escapes
like this:

,\"-fPIE\",\"--std=c++11\",\"-DGLM_FORCE_RADIANS\",\"-g\"


which causes a ton of errors.  If I turn host propagate flags off, I
then have to manually add --std=c++11 to the NVCC flags.  The problem
is that since I have CUDA_SEPARABLE_COMPILATION ON, the linker step
also gets --std=c++11, which is an error and compilation fails as a
result.  So, how do I resolve this?  Is there a way to have NVCC flags
only for compilation and not for linking?  Alternatively, is there a
way to avoid the crazy string escapes on the CXX flags passed to NVCC?


thanks,
wes


More information about the CMake mailing list