Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Changed how coarray preprocessor variable is defined to use the older…
Browse files Browse the repository at this point in the history
… CMAKE TARGET_COMPILE_DEFINITIONS instead of the newer ADD_DEFINITIONS
  • Loading branch information
daminton committed May 18, 2023
1 parent 297dedf commit 29afacf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ ENDIF(NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90)
OPTION(USE_COARRAY "Use Coarray Fortran for parallelization of test particles" OFF)
OPTION(USE_OPENMP "Use OpenMP for parallelization" ON)

IF (USE_COARRAY)
ADD_DEFINITIONS(-DCOARRAY)
ENDIF()

# Locate and set parallelization libraries. There are some CMake peculiarities
# taken care of here, such as the fact that the FindOpenMP routine doesn't know
# about Fortran.
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,16 @@ SET_SOURCE_FILES_PROPERTIES(${SWIFTEST_src} PROPERTIES Fortran_PREPROCESS ON)
# # Uncomment if you need to link to BLAS and LAPACK
TARGET_LINK_LIBRARIES(${SWIFTEST_DRIVER} ${NETCDF_LIBRARIES} ${NETCDF_FORTRAN_LIBRARIES})



IF(USE_OPENMP)
SET_TARGET_PROPERTIES(${SWIFTEST_DRIVER} PROPERTIES
COMPILE_FLAGS "${OpenMP_Fortran_FLAGS}"
LINK_FLAGS "${OpenMP_Fortran_FLAGS}")
ENDIF(USE_OPENMP)

IF(USE_COARRAY)
TARGET_COMPILE_DEFINITIONS(${SWIFTEST_DRIVER} PRIVATE -DCOARRAY)
SET_TARGET_PROPERTIES(${SWIFTEST_DRIVER} PROPERTIES
COMPILE_FLAGS "${Coarray_Fortran_FLAGS}"
LINK_FLAGS "${Coarray_Fortran_FLAGS}")
Expand Down

0 comments on commit 29afacf

Please sign in to comment.