Fixed the order of build flags for the dependency tree (dependencies must go first).