From :

In an interview with Collider, Suicide Squad director David Ayer revealed that The Flash’s cameo was shot in London, where Zack Snyder is currently directing Justice League. When Ezra Miller arrived to the set in April as The Flash, Snyder shot his quick 4 second cameo and then shipped the footage off to Los Angeles where Ayer was editing Suicide Squad.

Read the Full Story