Skip to content

Commit 6a3549c

Browse files
committed
build: COMPILER_ID update for supporting cmake >= 3.20.
1 parent e7d73f7 commit 6a3549c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ set(CUDASRC
2121
cuda/tdsops.f90
2222
)
2323

24-
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI")
24+
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI" OR
25+
${CMAKE_Fortran_COMPILER_ID} STREQUAL "NVHPC")
2526
list(APPEND SRC ${CUDASRC})
2627
endif()
2728

@@ -35,7 +36,8 @@ target_compile_options(x3d2 PRIVATE "-O3")
3536
target_compile_options(xcompact PRIVATE "-O3")
3637
target_compile_options(xcompact PRIVATE "-cpp")
3738

38-
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI")
39+
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI" OR
40+
${CMAKE_Fortran_COMPILER_ID} STREQUAL "NVHPC")
3941
target_compile_options(x3d2 PRIVATE "-cuda")
4042
target_compile_options(x3d2 PRIVATE "-fast")
4143
target_link_options(x3d2 INTERFACE "-cuda")

tests/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ set(CUDATESTSRC
88
cuda/test_cuda_transeq.f90
99
)
1010

11-
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI")
11+
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI" OR
12+
${CMAKE_Fortran_COMPILER_ID} STREQUAL "NVHPC")
1213
foreach(testfile IN LISTS CUDATESTSRC)
1314
get_filename_component(test_name ${testfile} NAME_WE)
1415

0 commit comments

Comments
 (0)