Secondary metabolites (SMs) are known to play important roles in the virulence and lifestyle of fungal plant pathogens. The increasing availability of fungal pathogen genome sequences and next-generation genomic tools have allowed us to survey the SM gene cluster inventory in individual fungi. Thus, there is immense opportunity for SM discovery in these plant pathogens. Comparative genomics and transcriptomics have been employed to obtain insights on the genetic features that enable fungal pathogens to adapt in individual ecological niches and to adopt the different pathogenic lifestyles. Here, we will discuss how we can use these tools to search for ecologically important SM gene clusters in fungi, using cereal pathogens as models. This ecological genomics approach, combined with genome mining and chemical ecology tools, is likely to advance our understanding of the natural functions of SMs and accelerate bioactive molecule discovery.