In an all-stock deal, the deal will be accretive as long as the buyer has a higher P/E multiple than the seller.
This is because the buyer is paying less for earnings (net income) than what the market values their own earnings at.