Skip to content

Fix subproject build #284

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 3 commits into from
Jan 5, 2021
Merged

Fix subproject build #284

merged 3 commits into from
Jan 5, 2021

Conversation

awvwgk
Copy link
Member

@awvwgk awvwgk commented Dec 29, 2020

Required changes to use stdlib as subproject in CMake.

@awvwgk awvwgk marked this pull request as draft December 29, 2020 09:41
@awvwgk awvwgk marked this pull request as ready for review December 29, 2020 15:17
@awvwgk awvwgk requested a review from jvdp1 December 29, 2020 15:33
@awvwgk awvwgk linked an issue Dec 29, 2020 that may be closed by this pull request
Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

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

Thank you @awvwgk for these improvements. Unfortunately my knowledge in CMake is really basic. So I am not sure to be the appropriate reviewer for these changes ;)
@certik @milancurcic Could you have a look, please?

For me (as far as I can check), it is good to be merge as is.

@awvwgk
Copy link
Member Author

awvwgk commented Jan 2, 2021

I created a repo to ease the review process of this PR: https://github.com/awvwgk/stdlib-cmake-example
You can check the subprojects/CMakeLists.txt and switch between my fork and this repo to investigate the difference for CMake integration.

@awvwgk awvwgk requested review from certik and milancurcic January 2, 2021 12:23
@milancurcic
Copy link
Member

I'm a true CMake n00b so I can't comment on the code. It seems good to me.

But I played with the stdlib-cmake-example and it works like a charm. Actually, CMake fetching stdlib and using it as a dependency felt like magic because I never did anything like that with CMake. So I think this will significantly lower the bar for using stdlib for some users.

I'm still a bit confused what this PR addresses exactly. If I'm not mistaken, the stdlib-cmake-example works as is with the current master. I think that is using the fetch method. Does this PR then allow using stdlib with the other method described in the stdlib-cmake-example README? Likely just me not understanding the CMake lingo.

Anyhow, whichever it is, I trust that this is good to go.

@awvwgk
Copy link
Member Author

awvwgk commented Jan 5, 2021

I'm still a bit confused what this PR addresses exactly. If I'm not mistaken, the stdlib-cmake-example works as is with the current master. I think that is using the fetch method. Does this PR then allow using stdlib with the other method described in the stdlib-cmake-example README? Likely just me not understanding the CMake lingo.

@milancurcic It does not, I currently let it fetch from my fork instead of the fortran-lang/stdlib repo (see https://github.com/awvwgk/stdlib-cmake-example/blob/623da353140578646daf125f6b6dd46981d9947a/subprojects/CMakeLists.txt#L11-L21). I force-pushed the repo a few times, the initial example fetching from fortran-lang/stdlib is still in the actions log at https://github.com/awvwgk/stdlib-cmake-example/runs/1636468980?check_suite_focus=true and has actually failed (see #285).

The repo README still explains it with the fortran-lang/stdlib repo, which will start to work once this PR is merged. Also, I will than match the implementation with the docs again 😉.

@milancurcic
Copy link
Member

@awvwgk Perfect, that's clear now. :)

@awvwgk
Copy link
Member Author

awvwgk commented Jan 5, 2021

I'll go ahead and merge this PR, we can still revert or patch it later.

@awvwgk awvwgk merged commit 0c50e78 into fortran-lang:master Jan 5, 2021
@awvwgk awvwgk deleted the subproject branch January 5, 2021 17:35
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.

stdlib cannot be used as CMake subproject
3 participants