Merge pull request #869 from davidgyu/cuda_build_fix

Fixed CUDA build with newer SDKs
This commit is contained in:
barfowl 2016-09-29 21:15:49 -07:00 committed by GitHub
commit 39c53b234a
3 changed files with 16 additions and 7 deletions

View File

@ -475,6 +475,22 @@ if(CUDA_FOUND)
-DOPENSUBDIV_HAS_CUDA
)
set(OSD_GPU TRUE)
if (UNIX)
list( APPEND CUDA_NVCC_FLAGS -Xcompiler -fPIC )
if (NOT DEFINED OSD_CUDA_NVCC_FLAGS)
if (CUDA_VERSION_MAJOR LESS 6)
set( OSD_CUDA_NVCC_FLAGS --gpu-architecture compute_11 )
else()
set( OSD_CUDA_NVCC_FLAGS --gpu-architecture compute_20 )
endif()
endif()
endif()
if (DEFINED OSD_CUDA_NVCC_FLAGS)
list( APPEND CUDA_NVCC_FLAGS ${OSD_CUDA_NVCC_FLAGS})
endif()
else()
if (NOT NO_CUDA)
message(WARNING

View File

@ -105,9 +105,6 @@ if (NOT NO_LIB)
if( CUDA_FOUND )
include_directories( "${CUDA_INCLUDE_DIRS}" )
if (UNIX)
list( APPEND CUDA_NVCC_FLAGS -Xcompiler -fPIC --gpu-architecture compute_11 )
endif()
endif()

View File

@ -294,10 +294,6 @@ if( CUDA_FOUND )
cudaD3D11VertexBuffer.h
)
endif()
if (UNIX)
list( APPEND CUDA_NVCC_FLAGS -Xcompiler -fPIC --gpu-architecture compute_11 )
endif()
endif()
list(APPEND DOXY_HEADER_FILES ${CUDA_PUBLIC_HEADERS})