- Download a source, http://www.python.org/ftp/python/3.1.2/Python-3.1.2.tar.bz2 . Unpack it.
- Open .\Python-3.1.2\PCbuild\pcbuild.sln , MSVS will convert it to VC10 version. (You should have latest version of MSVC2010 or an installed hotfix for project converting).
- Open configuration manager and create new configuration "ReleaseStatic" based on "Release" configuration. Select all projects, open project properties and set Runtime = "Multi-Threaded (/MT)" in Code Generation settings. You can also adjust another properties like LTCG, etc.
cl.exe ... -MD ..\Modules\getbuildinfo.c -Fogetbuildinfo.o -I..\Include -I..\PC
- Open .\Python-3.1.2\PCbuild\make_buildinfo.c and apply the following patch:
@@ -61,7 +61,10 @@ fprintf(stderr, "make_buildinfo $(ConfigurationName)\n"); return EXIT_FAILURE; } - if (strcmp(argv[1], "Release") == 0) { + if (strcmp(argv[1], "ReleaseStatic") == 0) { + strcat_s(command, CMD_SIZE, "-MT "); + } + else if (strcmp(argv[1], "Release") == 0) { strcat_s(command, CMD_SIZE, "-MD "); } else if (strcmp(argv[1], "Debug") == 0) {
Then pythoncore configuration properties, build events, pre-link event, and write there"$(SolutionDir)make_buildinfo.exe" ReleaseStatic
No comments:
Post a Comment