Hi all,

I'm trying out the CMake 3.9.0-rc3 support for CUDA with Visual Studio 
generators*, and trying to port over an existing project that uses FindCUDA. 
I'm sure I'm missing something obvious, but I can't see any mechanism to set 
-Xcompiler flags.

To be more explicit, I need to set /bigobj on the host compiler for a .cu file. 
If I use the CUDA Visual Studio Integration GUI, I can do this through CUDA 
C/C++->Host->Additional Compiler Options, which populates the 
CudaCompile\AdditionalCompilerOptions section of the .vcxproj. At compile time 
any flags in this field are passed to nvcc by the -Xcompiler flag, which in 
turn passes them through to the host compiler.

Unfortunately I cannot find any way to achieve this through CMake. I have tried 
to add it to CMAKE_CUDA_FLAGS like so:

set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler \"/bigobj\"")

But the generated .vcxproj does not have any trace of this line in it. (This 
method does work for setting -Xcudafe parameters as expected, but it almost 
seems like -Xcompiler flags are being deliberately stripped out.)

Is there some other mechanism for passing parameters into -Xcompiler?

Best wishes,
James Hancox


*To be precise, I'm using Visual Studio 12 2013 Win64 generator, CUDA 8.0.61 
and CMake 3.9.0-rc3.


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to