Skip to content

Commit 9de584a

Browse files
committed
check if compiler is_contiguous() capable
1 parent 3b2d457 commit 9de584a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/contiguous/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
set_property(DIRECTORY PROPERTY LABELS contiguous)
22

3+
check_fortran_source_compiles("
4+
program test
5+
implicit none
6+
real :: a(1)
7+
print '(L1)', is_contiguous(a)
8+
end program
9+
"
10+
HAVE_IS_CONTIGUOUS
11+
SRC_EXT f90
12+
)
13+
14+
if(NOT HAVE_IS_CONTIGUOUS)
15+
message(WARNING "Fortran compiler does not support is_contiguous")
16+
return()
17+
endif()
18+
319
add_library(contiguous_fortran ${PROJECT_SOURCE_DIR}/src/contiguous/contiguous.f90)
420
target_include_directories(contiguous_fortran INTERFACE ${PROJECT_SOURCE_DIR}/src/contiguous)
521

0 commit comments

Comments
 (0)