modify add_library dependencies to avoid cyclic dependency