There is no doubt that modern communication has brought some of the horror of war before the world in a way to perhaps demonstrate how awful it is. But still that does not seem to deter nations from indulging in it for very doubtful ends. To a great extent the ease with which a bullet or a bomb can destroy people has made war somehow more acceptable. A finger twitch can very easily destroy what it has taken a score of years to create in a viable intelligent human being. What is required is some way to reinforce the horror of killing someone to perhaps make it not quite so acceptable.
A secondary use of firearms in hunting is also looked at with a certain displeasure if it is merely used to blast beautiful animals into nothingness for mere sadistic pleasure. This displeasure is mitigated to a degree if the hunter eats what he or she kills.
Perhaps this secondary acceptance can be transferred to war to increase its horror to a degree that it will no longer be considered an easy solution to a problem.
If an international agreement were made that any people killed in combat, even if the deaths were proclaimed as accidental, would only be acceptable if the killers were forced to eat their victims. At least a portion of soldiers would be dissuaded from killing people, even those declared as enemies, if they were forced to eat them.
Of course, there is no doubt that another group, hopefully not too large, would not only enjoy killing people but also delight in eating them. Whole industries could be created in new ways to prepare and consume people and creative chefs would have a great time inventing new dishes. I have heard that Muslims and Jews refuse to eat pigs but I have never heard of any prohibitions about eating people so that should not be a problem.
It would no doubt solve some of the logistic problems in feeding large military forces and, at least to a degree, relieve the huge overpopulation of the globe by humans which is so threatening to all life on the planet.