Optical lithography is facing a great challenge from the continuous shrinkage of industry node toward 22nm or below. The increasing sensitivity to process variations becomes a key problem hindering further progress. To address this problem, inverse lithography, which designs pixelated masks with appropriate algorithms, is favored for its capacity of exploring a larger solution space. This search capacity, however, is limited by the fixed source configuration. To this end, optimization of pixelated source and pixelated mask together has come up for further performance improvement. In this paper, a source-mask co-optimization (SMO) algorithm, which incorporates process variations into the optimization scheme, is introduced. To further improve the process robustness, we apply weighted total variation and aerial image intensity control as regularization. Simulation results show that we achieve greater pattern fidelity and enhanced process robustness by using SMO.