Fix some bugs in build system.

N/A

Signed-off-by: liminghao <liminghao@xiaomi.com>