summaryrefslogtreecommitdiffstats
path: root/build/plugins/cmake_export.py
Commit message (Collapse)AuthorAgeFilesLines
* Add CMAKE_EXPORTED_TARGET_NAME_FROM_PATH macro, fix cmake target artefact ↵mikari2026-07-071-0/+35
rename rules- A project may contain many same-named programs: for example, each integration test directory defines its own PROGRAM() conventionally called `pipeline`. CMake requires target names to be unique across the whole project, so exporting such a subtree to opensource forces one to write CMAKE_EXPORTED_TARGET_NAME(unique-name) into every such module. The natural unique name is the module path, but hardcoding path-derived names in every ya.make is verbose and breaks on every repository move. This PR adds CMAKE_EXPORTED_TARGET_NAME_FROM_PATH(project/root): it derives the exported cmake target name from the module path automatically, cutting off the irrelevant common prefix (and validating that the module really lives under it). The output artefact keeps its short name, so tests and tooling that run the binary are unaffected. It also makes the underlying OUTPUT_NAME rename rules actually work in sem export: a multi-command variable value substituted in argument position of a sem string fails to render (`unexpected multicommand substitution`), so the variable is moved into its own command-position slot. commit_hash:aa970726f25773150cc839906aaddc98ee8ac412