Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: improve the warning for executables with the same name
adb1a36 added the feature and also the usual meson-style warning to users that might be using the feature but were not targeting a new enough meson version. Well unfortunately the warning both doesn't actually work (it didn't take different directories into account) and is also really slow because it creates an O(N^2) loop for checking this. Instead, rework this by adding an additional set that stores a tuple containing the target name and its subdirectory. We only add this tuple if the target is an executable since it is the only time it will be relevant. After that, simply check if the name + subdir combination already exists in the set along with the target being executable. If so, then we execute FeatureNew which may possibly warn. This is a simply O(1) lookup which is way faster. Fixes mesonbuild#12404.
- Loading branch information