File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -53,16 +53,18 @@ check_include_file("ISO_Fortran_binding.h" HAVE_ISO_FORTRAN_BINDING_H)
5353# otherwise, we'd need to use try_compile() with a project for each symbol
5454# IntelLLVM didn't need this trick
5555if (CMAKE_C_COMPILER_ID STREQUAL "GNU" )
56- set (CMAKE_REQUIRED_LIBRARIES " gfortran" )
56+ set (CMAKE_REQUIRED_LIBRARIES gfortran)
5757elseif (CMAKE_C_COMPILER_ID STREQUAL "NVHPC" )
58- set (CMAKE_REQUIRED_LIBRARIES "nvf" )
58+ set (CMAKE_REQUIRED_LIBRARIES nvf)
59+ elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang" )
60+ set (CMAKE_REQUIRED_LIBRARIES FortranRuntime FortranDecimal)
5961endif ()
6062
6163# some compilers (e.g. NVHPC) have ISO_Fortran_binding.h but don't
6264# have all the functions
6365if (HAVE_ISO_FORTRAN_BINDING_H)
64- check_symbol_exists(CFI_is_contiguous "ISO_Fortran_binding.h" HAVE_CFI_IS_CONTIGUOUS)
65- check_symbol_exists(CFI_setpointer "ISO_Fortran_binding.h" HAVE_CFI_SETPOINTER)
66+ check_symbol_exists(CFI_is_contiguous "ISO_Fortran_binding.h" HAVE_CFI_IS_CONTIGUOUS)
67+ check_symbol_exists(CFI_setpointer "ISO_Fortran_binding.h" HAVE_CFI_SETPOINTER)
6668endif ()
6769
6870endfunction ()
Original file line number Diff line number Diff line change @@ -38,14 +38,17 @@ if(HAVE_C_CHAR_PTR)
3838 add_executable (string_array string_array.cpp string_array.f90)
3939 set_property (TARGET string_array PROPERTY LINKER_LANGUAGE CXX)
4040 target_compile_options (string_array PRIVATE "$<$<COMPILE_LANG_AND_ID:Fortran,GNU>:-Wno-uninitialized>" )
41+
4142 add_test (NAME string_array COMMAND string_array)
4243 set_property (TEST string_array PROPERTY PASS_REGULAR_EXPRESSION
4344"red[ \n ]+green[ \n ]+blue" )
4445endif ()
4546
4647
47- add_executable (cfi_setpointer setpointer.f90 setpointer.c)
48- add_test (NAME CFI_setpointer COMMAND cfi_setpointer)
48+ if (HAVE_CFI_SETPOINTER)
49+ add_executable (cfi_setpointer setpointer.f90 setpointer.c)
50+ add_test (NAME CFI_setpointer COMMAND cfi_setpointer)
51+ endif ()
4952
5053foreach (t IN ITEMS cfi_setpointer sampling)
5154 if (TARGET ${t} )
You can’t perform that action at this time.
0 commit comments