Skip to content
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

UNITY_BUILD doesn't seem to propagate to dependent projects #56

Open
marthinsen opened this issue Aug 9, 2023 · 1 comment
Open

UNITY_BUILD doesn't seem to propagate to dependent projects #56

marthinsen opened this issue Aug 9, 2023 · 1 comment

Comments

@marthinsen
Copy link
Contributor

From this line of code:
https://github.com/cpp-best-practices/cmake_template/blob/d19d8921771ba582824948f0cc57f849a5c6efd8/ProjectOptions.cmake#L147C3-L147C98
One can get the impression that linking to myproject_options would be sufficient to enable unity build on a project. As far as I can tell that is not correct, the UNITY_BUILD property seems to not propagate to dependent projects. Or am I missing something here?

If one doesn't want set UNITY_BUILD globally, l guess one have to set the property for each target explicitly...

@ClausKlein
Copy link
Contributor

ClausKlein commented Aug 27, 2023

UNITY_BUILD does not work in this way, see CMAKE_UNITY_BUILD

But in generell it should be used for libraries because it may reduce the build time dramatically.

see #63 for example

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

No branches or pull requests

2 participants