Skip to content

Use shorter names in internal TARGET_PROPERTY expressions

Brad King requested to merge brad.king/cmake:gt-shorter-unique-names into master

The change in !2370 (merged) introduced globally unique names in synthesized $<TARGET_PROPERTY:...> generator. We used the pattern <target-name>::T<pointer-to-generator-target> to guarantee uniqueness. However, in projects that require many such expressions to be generated there was a measurable increase in runtime.

We had included the target name in the synthesized genex only for human reference during debugging. It is not necessary. Switch to the pattern :<pointer-to-generator-target> to shorten the name. Also hand-roll a hex-print loop instead of using sprintf. Together these optimizations get at least some of the time back.

Issue: #18964 (closed)

Merge request reports