Closed antoinebou12 closed 1 month ago
The problem is not with the platform, it's with how the flags are passed to the underlying compiler (nvcc). Position independent code is not specific to Windows. Just set the POSITION_INDEPENDENT_CODE
property to ON for the relevant target, or set the global CMAKE_POSITION_INDEPENDENT_CODE
. CMake will know not to add the -fPIC
flag when nvcc is invoked versus when the native build tool is invoked.
-- Building for: Visual Studio 17 2022 -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631. -- The CXX compiler identification is MSVC 19.41.34120.0 -- Looking for a CUDA compiler -- Looking for a CUDA compiler - C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/bin/nvcc.exe -- The CUDA compiler identification is NVIDIA 12.6.68