Skip to content

Separate build targets from model structure #369

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

Merged
merged 6 commits into from
Mar 6, 2021
Merged

Separate build targets from model structure #369

merged 6 commits into from
Mar 6, 2021

Conversation

LKedward
Copy link
Member

As discussed previously the list of build targets (build_target_t) is specific to the native backend and hence doesn't strictly belong in the model structure (which is ideally backend-independent).

This PR separates the list of build targets from the model structure and therefore provides a better distinction between the package representation and the fpm backend. In particular this refactoring removes some existing complication and redundancy in the treatment of compiler and linker flags which are now passed to the backend on a per target basis. As a result the backend is further simplified and importantly this paves the way for #112 (managing flags) and #358 (Improve support for include statements).

Backend simplified to use compiler and linker flags on per target basis.
Removes redundant link_flags field in model structure.
Fixes benign issue with duplicated link flags.
Copy link
Member

@awvwgk awvwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks this is a useful refactoring.

In the long term we should aim for a solution which doesn't require to generates in a context where they are not required, i.e. the installer. Does the model know without creating the targets about the executables in the current project?

@LKedward
Copy link
Member Author

LKedward commented Mar 6, 2021

In the long term we should aim for a solution which doesn't require to generates in a context where they are not required, i.e. the installer.

Thanks for reviewing, yes I agree with you on this point.

@LKedward LKedward merged commit 79d7fb6 into fortran-lang:master Mar 6, 2021
@LKedward LKedward deleted the separate-targets branch March 6, 2021 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants