Skip to content

Commit f008516

Browse files
committed
Remove redundant hacked CMake module
- Pass the `-fcoarray=single` flag to the builtin CMake macro `CHECK_Fortran_SOURCE_COMPILES` from the `CheckFortranSourceCompiles` builtin macro, using the standard `CMAKE_REQUIRED_FLAGS
1 parent 5527264 commit f008516

File tree

2 files changed

+7
-139
lines changed

2 files changed

+7
-139
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,20 @@ else()
8787
endif()
8888
endif()
8989

90-
91-
include(CheckFortranSourceCompiles.cmake)
90+
if(gfortran_compiler)
91+
set(CMAKE_REQUIRED_FLAGS "-fcoarray=single")
92+
endif()
93+
include(CheckFortranSourceCompiles)
9294
CHECK_Fortran_SOURCE_COMPILES("
9395
program main
9496
implicit none
9597
integer :: i
9698
i = this_image()
9799
end program
98100
" Check_Simple_Coarray_Fortran_Source_Compiles)
101+
if(gfortran_compiler)
102+
unset(CMAKE_REQUIRED_FLAGS)
103+
endif()
99104

100105
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
101106

CheckFortranSourceCompiles.cmake

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)