Skip to content

Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs

Brad King requested to merge brad.king/cmake:nmc-target-objects into master

Since !6161 (merged) the TARGET_OBJECTS genex, when referenced for linking, is now evaluated with EvaluateForBuildsystem enabled. This causes the object file paths to be computed with a buildsystem-specific placeholder for the configuration.

This is normally fine because the placeholder will be evaluated by the native buildsystem tool using the proper configuration. However, the Ninja Multi-Config generator's ${CONFIGURATION} placeholder may not have the correct value for cross-config object files. Switch back to using the per-config location of each object file for this generator.

Fixes: #22436 (closed)
Backport: release

Merge request reports