Skip to content

Conversation

crueter
Copy link
Contributor

@crueter crueter commented Sep 8, 2025

SOURCE vs CURRENT_SOURCE is unreliable. DEFINED PROJECT_NAME is a much more portable way of determination.

Also, installation shouldn't default to on if it is a subproject.

…roject

SOURCE vs CURRENT_SOURCE is unreliable. `DEFINED PROJECT_NAME` is a much more portable way of determination.

Also, installation shouldn't default to on if it is a subproject.
@crueter crueter changed the title [cmake] fix MASTER_PROJECT heuristic; only enable install if master p… [cmake] fix MASTER_PROJECT heuristic; only enable install if root Sep 8, 2025
@vitaut
Copy link
Contributor

vitaut commented Sep 8, 2025

Thanks for the PR but could you elaborate why the current check is unreliable?

@crueter
Copy link
Contributor Author

crueter commented Sep 8, 2025

Thanks for the PR but could you elaborate why the current check is unreliable?

With CPM.cmake and I believe FetchContent, FMT_MASTER_PROJECT would always evaluate to ON since those set CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR for this subdirectory. I remember there being some good reason for this but I can't recall exactly what it is; regardless, with this change, FMT_MASTER_PROJECT now works in all scenarios I tried: CPM, FetchContent, Git submodules, and as a standalone project.

@vitaut vitaut merged commit da97ba2 into fmtlib:master Sep 10, 2025
40 checks passed
@vitaut
Copy link
Contributor

vitaut commented Sep 10, 2025

Merged, thanks!

@crueter crueter deleted the patch-1 branch September 10, 2025 18:23
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Sep 30, 2025
`fmtlib` version was updated to 12.0.0 in #163441.

In this new version, due to fmtlib/fmt#4536, PyTorch started not installing `fmtlib` headers anymore. Because of that, PyTorch/XLA build CI started to fail pytorch/xla#9653. While we did fix it internally pytorch/xla#9650, I believe that PyTorch should continue installing the `fmtlib` headers, since it is a dependency of its C API [`python_arg_parser.h`][1].

PyTorch/XLA CI was moved to `unstable.yml` in #159272, and later removed in #163564. This PyTorch/XLA build failure went under the radar, since the `fmtlib` update only landed on September 22.

[1]: https://github.com/pytorch/pytorch/blob/84d673ef577d42d6ec20c6c9f09863583c3111f5/torch/csrc/utils/python_arg_parser.h#L42
Pull Request resolved: #164139
Approved by: https://github.com/Skylion007, https://github.com/malfet
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