Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with calling ACG multiple times #1448

Merged
merged 3 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fix issue where ACG was called when no file had changed

### Added

### Changed

- Cleaned up a bit of old CMake

### Removed

### Deprecated
Expand Down
8 changes: 4 additions & 4 deletions cmake/mapl_acg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ function (mapl_acg target specs_file)
string (REPLACE "_GridComp" "" component_name ${target})

if (ARGS_UNPARSED_ARGUMENTS)
ecbuild_error ("maple_acg() - unparsed arguments: ${ARGS_UNPARSED_ARGUMENTS}")
ecbuild_error ("mapl_acg() - unparsed arguments: ${ARGS_UNPARSED_ARGUMENTS}")
endif ()

set (generated) # empty unless
set (options "")

set (suffix_for_generated_include_files "___.h")

# Handle oneValueArgs with no value (Python provides default)
foreach (opt flag default IN ZIP_LISTS oneValueArgs flags defaults)
Expand All @@ -44,7 +44,7 @@ function (mapl_acg target specs_file)
list (APPEND options ${flag} ${ARGS_${opt}})
elseif (${opt} IN_LIST ARGS_KEYWORDS_MISSING_VALUES)
string (REPLACE "{component}" component_name fname ${default})
list (APPEND generated ${fname})
list (APPEND generated "${component_name}_${fname}${suffix_for_generated_include_files}")
list (APPEND options ${flag})
endif ()

Expand All @@ -60,7 +60,7 @@ function (mapl_acg target specs_file)
add_custom_command (
OUTPUT ${generated}
COMMAND ${generator} ${CMAKE_CURRENT_SOURCE_DIR}/${specs_file} ${options}
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${specs_file}
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${specs_file}
DEPENDS ${generator} ${specs_file}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating automatic code for ${specs_file}"
Expand Down
3 changes: 1 addition & 2 deletions gridcomps/ExtData2G/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ set (srcs
esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL.base MAPL.generic MAPL.griddedio TYPE SHARED)
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared YAFYAML::yafyaml esmf NetCDF::NetCDF_Fortran
PRIVATE MPI::MPI_Fortran)
target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}
$<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)

set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}})