-
Notifications
You must be signed in to change notification settings - Fork 19
Fypp robustness #53
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
base: develop
Are you sure you want to change the base?
Fypp robustness #53
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ else() | |
| elseif( @HAVE_FCKIT_VENV@ ) | ||
| set( _fckit_eval_script ${fckit_BASE_DIR}/libexec/fckit-eval.sh ) | ||
| set( FCKIT_VENV_EXE ${fckit_BASE_DIR}/@rel_venv_exe_path@ ) | ||
| set( FYPP ${_fckit_eval_script} ${FCKIT_VENV_EXE} -m fypp ) | ||
| set( FYPP ${FCKIT_VENV_EXE} -m fypp ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fckit_eval_script is necessary, because it allowed to exclude some arguments:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which downstream app was the eval script causing a problem for? I solved a similar problem for FIELD_API in the past, so I might be able to help. |
||
| else() | ||
| set( FYPP ${fckit_BASE_DIR}/libexec/fckit-eval.sh | ||
| ${fckit_BASE_DIR}/libexec/fckit-fypp.py ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,27 +20,6 @@ function( fckit_target_append_fypp_args output target ) | |
| set( valid_target FALSE ) | ||
| endif() | ||
| endif() | ||
| if( valid_target ) | ||
| if( CMAKE_VERSION VERSION_LESS 3.12 ) # Hopefully we can remove this soon | ||
| foreach( include_property INCLUDE_DIRECTORIES;INTERFACE_INCLUDE_DIRECTORIES ) | ||
| set( prop "$<TARGET_PROPERTY:${target},${include_property}>" ) | ||
| list( APPEND _args "$<$<BOOL:${prop}>:-I $<JOIN:${prop}, -I >>" ) | ||
| endforeach() | ||
| foreach( definitions_property COMPILE_DEFINITIONS;INTERFACE_COMPILE_DEFINITIONS ) | ||
| set( prop "$<TARGET_PROPERTY:${target},${definitions_property}>" ) | ||
| list( APPEND _args "$<$<BOOL:${prop}>:-D $<JOIN:${prop}, -D >>" ) | ||
| endforeach() | ||
| else() | ||
| foreach( include_property INCLUDE_DIRECTORIES;INTERFACE_INCLUDE_DIRECTORIES ) | ||
| set( prop "$<$<TARGET_EXISTS:${target}>:$<TARGET_PROPERTY:${target},${include_property}>>" ) | ||
| list( APPEND _args "$<$<BOOL:${prop}>:-I $<JOIN:${prop}, -I >>" ) | ||
| endforeach() | ||
| foreach( definitions_property COMPILE_DEFINITIONS;INTERFACE_COMPILE_DEFINITIONS ) | ||
| set( prop "$<$<TARGET_EXISTS:${target}>:$<TARGET_PROPERTY:${target},${definitions_property}>>" ) | ||
| list( APPEND _args "$<$<BOOL:${prop}>:-D $<JOIN:${prop}, -D >>" ) | ||
| endforeach() | ||
| endif() | ||
| endif() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is required to automatically give the fypp preprocessor access to the target compile definitions and target include directories. |
||
| # Append to output and set in parent scope | ||
| if( _args ) | ||
| set(${output} ${${output}} ${_args} PARENT_SCOPE) | ||
|
|
@@ -192,7 +171,7 @@ function( fckit_target_preprocess_fypp _PAR_TARGET ) | |
|
|
||
| set( options NO_LINE_NUMBERING ) | ||
| set( single_value_args "" ) | ||
| set( multi_value_args FYPP_ARGS FYPP_ARGS_EXCLUDE DEPENDS ) | ||
| set( multi_value_args FYPP_ARGS FYPP_ARGS_EXCLUDE DEPENDS INCLUDEDIRS ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be consistent with |
||
| cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} ) | ||
|
|
||
| if( TARGET ${_PAR_TARGET} ) | ||
|
|
@@ -245,6 +224,10 @@ function( fckit_target_preprocess_fypp _PAR_TARGET ) | |
| set( _NO_LINE_NUMBERING NO_LINE_NUMBERING ) | ||
| endif() | ||
|
|
||
| foreach( dir ${_PAR_INCLUDEDIRS} ) | ||
| list( APPEND args -I ${dir} ) | ||
| endforeach() | ||
|
|
||
| fckit_preprocess_fypp_sources( preprocessed_sources | ||
| SOURCES ${sources_to_be_preprocessed} | ||
| ${_NO_LINE_NUMBERING} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with ecbuild_add_test we should use
INCLUDES, and they should already be part of the signature of add_fctest which just extendsecbuild_add_test.