def set_vcxproj_runtime_library(path_to_vcxproj, runtime_library): """ Change runtime library of vcxproj file :param path_to_vcxproj: Path to vcxproj :param runtime_library: (MT, MD) :return: """ if runtime_library not in ('MT', 'MD'): raise Exception("Invalid runtime library") sys.exit(1) project = Builder(path_to_vcxproj) debug_conf = project.get_configuration("Debug") debug_runtime_library = Builder.runtimeLibraries[runtime_library + "d"] debug_conf.set_runtime_library(debug_runtime_library) debug_conf.save() release_runtime_library = Builder.runtimeLibraries[runtime_library] release_conf = project.get_configuration("Release") release_conf.set_runtime_library(release_runtime_library) release_conf.save()