Skip to content

Commit

Permalink
Merge pull request #264 from ecmwf-ifs/naan-more-cmake-fixes
Browse files Browse the repository at this point in the history
[CMake] Expose GLOBAL_VAR_OFFLOAD and INCLUDES in loki_transform_target
  • Loading branch information
reuterbal authored Apr 8, 2024
2 parents 0a15267 + 5429ad5 commit 09d0bd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions cmake/loki_transform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ function( loki_transform_target )

set( options
NO_PLAN_SOURCEDIR COPY_UNMODIFIED CPP CPP_PLAN INLINE_MEMBERS
RESOLVE_SEQUENCE_ASSOCIATION DERIVE_ARGUMENT_ARRAY_SHAPE TRIM_VECTOR_SECTIONS
RESOLVE_SEQUENCE_ASSOCIATION DERIVE_ARGUMENT_ARRAY_SHAPE TRIM_VECTOR_SECTIONS GLOBAL_VAR_OFFLOAD
)
set( single_value_args TARGET COMMAND MODE DIRECTIVE FRONTEND CONFIG PLAN )
set( multi_value_args SOURCES HEADERS DEFINITIONS )
set( multi_value_args SOURCES HEADERS DEFINITIONS INCLUDES )

cmake_parse_arguments( _PAR_T "${options}" "${single_value_args}" "${multi_value_args}" ${ARGN} )

Expand Down Expand Up @@ -307,6 +307,10 @@ function( loki_transform_target )
list( APPEND _TRANSFORM_OPTIONS TRIM_VECTOR_SECTIONS )
endif()

if( _PAR_T_GLOBAL_VAR_OFFLOAD )
list( APPEND _TRANSFORM_OPTIONS GLOBAL_VAR_OFFLOAD )
endif()

loki_transform(
COMMAND ${_PAR_T_COMMAND}
OUTPUT ${LOKI_SOURCES_TO_APPEND}
Expand All @@ -318,6 +322,7 @@ function( loki_transform_target )
SOURCES ${_PAR_T_SOURCES}
HEADERS ${_PAR_T_HEADERS}
DEFINITIONS ${_PAR_T_DEFINITIONS}
INCLUDES ${_PAR_T_INCLUDES}
DEPENDS ${LOKI_SOURCES_TO_TRANSFORM} ${_PAR_T_HEADER} ${_PAR_T_CONFIG}
${_TRANSFORM_OPTIONS}
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/loki_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def transform_subroutine(self, routine, **kwargs):

@cli.command('plan')
@click.option('--mode', '-m', default='sca',
type=click.Choice(['idem', 'sca', 'claw', 'scc', 'scc-hoist', 'scc-stack']))
type=click.Choice(['idem', 'idem-stack', 'sca', 'claw', 'scc', 'scc-hoist', 'scc-stack']))
@click.option('--config', '-c', type=click.Path(),
help='Path to configuration file.')
@click.option('--header', '-I', type=click.Path(), multiple=True,
Expand Down

0 comments on commit 09d0bd2

Please sign in to comment.