build: move compute_library_subdir to where it is used
#29511
Merged
compute_library_subdir to where it is used
#29511