Skip to content

cmake: add generator deps#17415

Closed
junghans wants to merge 2 commits intodevelopfrom
features/cmake_deps
Closed

cmake: add generator deps#17415
junghans wants to merge 2 commits intodevelopfrom
features/cmake_deps

Conversation

@junghans
Copy link
Copy Markdown
Contributor

@junghans junghans commented Jul 7, 2020

I came across a system with an ancient gmake....

@junghans junghans requested a review from adamjstewart July 7, 2020 17:17
@junghans
Copy link
Copy Markdown
Contributor Author

junghans commented Jul 7, 2020

@alalazo I don't really understand the error message, can you have a look?

if generator == 'Unix Makefiles':
depends_on('gmake', type='build')
elif generator == 'Ninja':
depends_on('ninja', type='build')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this will work, since generator will always be Unix Makefiles at this point when reading the file, it isn't overwritten until it reads the subclass file. We could use a when spec, but we purposefully didn't include the generator in the spec since it doesn't change what gets installed. Also, I don't think gmake is specifically required, any new-enough make should work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, what would be the best way to pull in the generator?

Something like depends_on('cmake generator="Ninja"') in package.py seems a bit redundant.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we should add a variant to the cmake package since that will cause needless duplication of builds (cmake generator=ninja would be different from cmake generator=make). I have a vague idea of an approach that might work (using metaclasses) if the goal is to append a dependency on make or ninja to any CMakePackage based on the inspection of some class attribute. I need to check the details though to be sure it can be implemented smoothly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@alalazo any news on this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not yet....

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Sep 16, 2021

Closing since this won't work right now, but linked this PR in spack/seps#3 to account for this use case while we design extensions on the build systems.

@alalazo alalazo closed this Sep 16, 2021
@alalazo alalazo deleted the features/cmake_deps branch September 16, 2021 11:25
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.

3 participants