The pair will act opposite each other as Cornish plays a maid to Gleeson's war criminal character, reports Deadline.
Gleeson's character is in hiding and his maid becomes his only human contact.
Brad Silberling, who penned the screenplay, will direct and co-produce the movie, which begins shooting in Serbia this fall.
Cornish has previously appeared in W.E., Sucker Punch, Limitless and Bright Star.
Gleeson was nominated for a BAFTA and a Golden Globe for his role of Ken in the 2008 movie In Bruges.
Watch the trailer for W.E. below: