Can't get rid of “warning: command line option ‘-std=c++11’” using nvcc/CUDA/cmake
问题 When I compile my cuda code with cmake, I can't seem to get the following warning to go away: cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C [enabled by default] I have reduced the problem to the compilation, not my source code. Here is a simplified (but working) example: main.cu: #include <iostream> int main(void) { std::cout << "test" << std::endl; } CMakeLists.txt: cmake_minimum_required(VERSION 3.0.3) project(a_test) find_package(CUDA REQUIRED)