diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineFortranCompiler.cmake | 3 | ||||
-rw-r--r-- | Modules/CMakeFortranCompiler.cmake.in | 2 | ||||
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 087c0f6..d169012 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -284,6 +284,9 @@ if(MSVC_Fortran_ARCHITECTURE_ID) set(SET_MSVC_Fortran_ARCHITECTURE_ID "set(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})") endif() +if(CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") + set(CMAKE_Fortran_VENDOR_SOURCE_FILE_EXTENSIONS ";cuf;CUF") +endif() # configure variables set in this file for fast reload later on configure_file(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in ${CMAKE_PLATFORM_INFO_DIR}/CMakeFortranCompiler.cmake diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index 97f891e..f52ad02 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -25,7 +25,7 @@ set(CMAKE_Fortran_COMPILER_ENV_VAR "FC") set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@) set(CMAKE_Fortran_COMPILER_ID_RUN 1) -set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;fpp;FPP;f77;F77;f90;F90;for;For;FOR;f95;F95) +set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;fpp;FPP;f77;F77;f90;F90;for;For;FOR;f95;F95@CMAKE_Fortran_VENDOR_SOURCE_FILE_EXTENSIONS@) set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_Fortran_LINKER_PREFERENCE 20) if(UNIX) diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index 365b72a..62e54c8 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -1060,7 +1060,9 @@ if(CUDAToolkit_FOUND) if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.1.0) if(NOT TARGET CUDA::nvptxcompiler_static) _CUDAToolkit_find_and_add_import_lib(nvptxcompiler_static DEPS cuda_driver) - target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads) + if(TARGET CUDA::nvptxcompiler_static) + target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads) + endif() endif() endif() |