CUDA nvcc fails due to wrong option -pthread
I am using cmake 3.15.5. I build CUDA projects as libraries and use deferred linking, as these libraries will be used to create other static libraries The same code runs fine in Windows, but fails in Linux due to the added -pthread which fails nvcc. The problem only happens in Linux when i add target_link_libraries with some libraries the CUDA project needs.
I am attaching a code snippet to the problem from one of the projects:
This file will work in Windows, but will fail in Linux. Still removing the target_link_libraries will also make it work in Linux, but than the libraries will be missed later on
Thanks
Edited by Keter Sharon