Skip to content

Commit

Permalink
FYPP: propagate dependencies of fypp files (ecmwf#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab authored Dec 5, 2024
1 parent 00584ee commit 76898d5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmake/fckit_preprocess_fypp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,17 @@ function( fckit_preprocess_fypp_sources output )
set( short_outfile "${base}.F90")
endif()

get_source_file_property( _depends ${filename} OBJECT_DEPENDS )

unset( ${filename}_depends )
if( _depends )
set( ${filename}_depends ${_depends} )
endif()

add_custom_command(
OUTPUT ${outfile}
COMMAND ${CMAKE_COMMAND} -E env FCKIT_EVAL_ARGS_EXCLUDE="${_PAR_FYPP_ARGS_EXCLUDE}" ${FYPP} ${args} ${CMAKE_CURRENT_SOURCE_DIR}/${filename} ${outfile}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${filename} ${_PAR_DEPENDS}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${filename} ${_PAR_DEPENDS} ${${filename}_depends}
COMMENT "[fypp] Preprocessor generating ${short_outfile}" )

set_source_files_properties(${outfile} PROPERTIES GENERATED TRUE)
Expand Down

0 comments on commit 76898d5

Please sign in to comment.