Skip to content

Commit

Permalink
Use foreach loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
timcera committed Jan 24, 2024
1 parent d84ebe0 commit f98cd41
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,17 @@ if(CMAKE_BUILD_TYPE MATCHES "Debug")
# main CMakeLists.txt.
# Need to turn off bounds checking for fftpack.F, sptranf.f, and sptranfv.f
# in order to pass tests.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set_source_files_properties(fftpack.F PROPERTIES COMPILE_FLAGS -check=nobounds)
set_source_files_properties(sptranf.f PROPERTIES COMPILE_FLAGS -check=nobounds)
set_source_files_properties(sptranfv.f PROPERTIES COMPILE_FLAGS -check=nobounds)
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set_source_files_properties(fftpack.F PROPERTIES COMPILE_FLAGS -fcheck=no-bounds)
set_source_files_properties(sptranf.f PROPERTIES COMPILE_FLAGS -fcheck=no-bounds)
set_source_files_properties(sptranfv.f PROPERTIES COMPILE_FLAGS -fcheck=no-bounds)
else()
set_source_files_properties(fftpack.F PROPERTIES COMPILE_FLAGS -fno-bounds-check)
set_source_files_properties(sptranf.f PROPERTIES COMPILE_FLAGS -fno-bounds-check)
set_source_files_properties(sptranfv.f PROPERTIES COMPILE_FLAGS -fno-bounds-check)
foreach(filename fftpack.F sptranf.f sptranfv.f)
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set_source_files_properties(${filename} PROPERTIES COMPILE_FLAGS -check=nobounds)
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set_source_files_properties(${filename} PROPERTIES COMPILE_FLAGS -fcheck=no-bounds)
else()
set_source_files_properties(${filename} PROPERTIES COMPILE_FLAGS -fno-bounds-check)
endif()
endif()
endif()
endforeach()
endif()

# Build _4, _d, and/or _8 depending on options provided to CMake
Expand Down

0 comments on commit f98cd41

Please sign in to comment.