add subdir option, fix #18176

add subdir option, fix #18176