Use the same logic as in check_libraries.cmd Pull Request: https://projects.blender.org/blender/blender/pulls/128600