From a42533ebd9d0a5eceea32ab4fd06e641396d7794 Mon Sep 17 00:00:00 2001 From: trentmillar Date: Sat, 1 Sep 2012 11:42:59 -0600 Subject: [PATCH 1/4] adding VC2012 sln. Also to build-win32.bat I changed the ordering in the bat file to process newer VC versions before older ones. This was an issue for me running multiple versions of VS on my box --- build-win32.bat | 16 ++++--- cocos2d-win32.vc2012.sln | 94 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 cocos2d-win32.vc2012.sln diff --git a/build-win32.bat b/build-win32.bat index ebd9c837f4..68c9444dde 100644 --- a/build-win32.bat +++ b/build-win32.bat @@ -5,16 +5,19 @@ echo.* Check VC++ environment... echo.*/ echo. -if defined VS90COMNTOOLS ( - set VSVARS="%VS90COMNTOOLS%vsvars32.bat" - set VC_VER=90 +if defined VS110COMNTOOLS ( + set VSVARS="%VS110COMNTOOLS%vsvars32.bat" + set VC_VER=110 ) else if defined VS100COMNTOOLS ( set VSVARS="%VS100COMNTOOLS%vsvars32.bat" set VC_VER=100 -) +) else if defined VS90COMNTOOLS ( + set VSVARS="%VS90COMNTOOLS%vsvars32.bat" + set VC_VER=90 +) if not defined VSVARS ( - echo Can't find VC2008 or VC2010 installed! + echo Can't find VC2008, VC2010 or VC2012 installed! goto ERROR ) @@ -29,6 +32,9 @@ if %VC_VER%==90 ( ) else if %VC_VER%==100 ( msbuild cocos2d-win32.vc2010.sln /p:Configuration="Debug" msbuild cocos2d-win32.vc2010.sln /p:Configuration="Release" +) else if %VC_VER%==110 ( + msbuild cocos2d-win32.vc2012.sln /p:Configuration="Debug" + msbuild cocos2d-win32.vc2012.sln /p:Configuration="Release" ) else ( echo Script error. goto ERROR diff --git a/cocos2d-win32.vc2012.sln b/cocos2d-win32.vc2012.sln new file mode 100644 index 0000000000..79ba236ca0 --- /dev/null +++ b/cocos2d-win32.vc2012.sln @@ -0,0 +1,94 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "external\Box2D\proj.win32\Box2D.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosDenshion", "CocosDenshion\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "cocos2dx\proj.win32\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "scripting\lua\proj.win32\liblua.vcxproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "samples\HelloLua\proj.win32\HelloLua.vcxproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp", "samples\HelloCpp\proj.win32\HelloCpp.vcxproj", "{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpp", "samples\TestCpp\proj.win32\TestCpp.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestJavascript", "samples\TestJavascript\proj.win32\TestJavascript.vcxproj", "{D0F06A44-A245-4D13-A498-0120C203B539}" + ProjectSection(ProjectDependencies) = postProject + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLua", "samples\TestLua\proj.win32\TestLua.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}" + ProjectSection(ProjectDependencies) = postProject + {21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28} + {DDC3E27F-004D-4DD4-9DD3-931A013D2159} = {DDC3E27F-004D-4DD4-9DD3-931A013D2159} + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} + {929480E7-23C0-4DF6-8456-096D71547116} = {929480E7-23C0-4DF6-8456-096D71547116} + {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} + EndProjectSection +EndProject +Global + GlobalSection(DPCodeReviewSolutionGUID) = preSolution + DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32 + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.ActiveCfg = Debug|Win32 + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32 + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32 + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.Build.0 = Release|Win32 + {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.ActiveCfg = Debug|Win32 + {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.Build.0 = Debug|Win32 + {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.ActiveCfg = Release|Win32 + {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.Build.0 = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32 + {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.ActiveCfg = Debug|Win32 + {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.Build.0 = Debug|Win32 + {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.ActiveCfg = Release|Win32 + {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.Build.0 = Release|Win32 + {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.ActiveCfg = Debug|Win32 + {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.Build.0 = Debug|Win32 + {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.ActiveCfg = Release|Win32 + {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.Build.0 = Release|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.ActiveCfg = Debug|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.Build.0 = Debug|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.ActiveCfg = Release|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.Build.0 = Release|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32 + {D0F06A44-A245-4D13-A498-0120C203B539}.Debug|Win32.ActiveCfg = Debug|Win32 + {D0F06A44-A245-4D13-A498-0120C203B539}.Debug|Win32.Build.0 = Debug|Win32 + {D0F06A44-A245-4D13-A498-0120C203B539}.Release|Win32.ActiveCfg = Release|Win32 + {D0F06A44-A245-4D13-A498-0120C203B539}.Release|Win32.Build.0 = Release|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.ActiveCfg = Debug|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.ActiveCfg = Debug|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.Build.0 = Debug|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.ActiveCfg = Release|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal From a12054c00f57b686f31b2a810d9777805520f3d4 Mon Sep 17 00:00:00 2001 From: Trent Millar Date: Sat, 1 Sep 2012 14:32:46 -0600 Subject: [PATCH 2/4] Adding the VC++2012 template to install-templates-msvc.bat Tested against VS2012 RTM. Note, the .sln location is incorect on all the templates. It needs to move up relative to the cocos2d-x folder. I can look at fixing this later but for now I guess it must have been left to the user to manually move it. --- install-templates-msvc.bat | 35 ++-- template/msvc/InstallWizardForVS2012.js | 239 ++++++++++++++++++++++++ 2 files changed, 257 insertions(+), 17 deletions(-) create mode 100644 template/msvc/InstallWizardForVS2012.js diff --git a/install-templates-msvc.bat b/install-templates-msvc.bat index a603e4fa2c..0a3818dd53 100644 --- a/install-templates-msvc.bat +++ b/install-templates-msvc.bat @@ -1,17 +1,18 @@ - -echo./* -echo.* Install Cocos2d-win32 application wizard... -echo.*/ -echo. - -set SCRIPT_LOG=InstallWizardLog.txt -set SCRIPT_DIR=.\template\msvc\ - -if exist %SCRIPT_LOG% del /Q %SCRIPT_LOG% -cscript "%SCRIPT_DIR%InstallWizardForVC2008Express.js" /quiet -cscript "%SCRIPT_DIR%InstallWizardForVC2010Express.js" /quiet -cscript "%SCRIPT_DIR%InstallWizardForVS2008.js" /quiet -cscript "%SCRIPT_DIR%InstallWizardForVS2010.js" /quiet -if exist %SCRIPT_LOG% more %SCRIPT_LOG% -if exist %SCRIPT_LOG% del /Q %SCRIPT_LOG% - + +echo./* +echo.* Install Cocos2d-win32 application wizard... +echo.*/ +echo. + +set SCRIPT_LOG=InstallWizardLog.txt +set SCRIPT_DIR=.\template\msvc\ + +if exist %SCRIPT_LOG% del /Q %SCRIPT_LOG% +cscript "%SCRIPT_DIR%InstallWizardForVC2008Express.js" /quiet +cscript "%SCRIPT_DIR%InstallWizardForVC2010Express.js" /quiet +cscript "%SCRIPT_DIR%InstallWizardForVS2008.js" /quiet +cscript "%SCRIPT_DIR%InstallWizardForVS2010.js" /quiet +cscript "%SCRIPT_DIR%InstallWizardForVS2012.js" /quiet +if exist %SCRIPT_LOG% more %SCRIPT_LOG% +if exist %SCRIPT_LOG% del /Q %SCRIPT_LOG% + diff --git a/template/msvc/InstallWizardForVS2012.js b/template/msvc/InstallWizardForVS2012.js new file mode 100644 index 0000000000..a1b02be4eb --- /dev/null +++ b/template/msvc/InstallWizardForVS2012.js @@ -0,0 +1,239 @@ +// Setup program for the Cocos2d-win32 App Wizard for VC++ 11.0 (VC2012) + +main(); + +function EchoInfo(bQuiet, strMsg) { + if (! bQuiet) { + WScript.Echo(strMsg); + } + else { + var FileSys = new ActiveXObject("Scripting.FileSystemObject"); + var strLogPath = "InstallWizardLog.txt" + var file = FileSys.OpenTextFile(strLogPath, 8, true); + file.WriteLine(strMsg); + file.Close(); + } +} + +function EchoError(bQuiet, strMsg) { + strMsg = "Error: " + strMsg; + if (! bQuiet) { + WScript.Echo(strMsg); + } + else { + var FileSys = new ActiveXObject("Scripting.FileSystemObject"); + var strLogPath = "InstallWizardLog.txt" + var file = FileSys.OpenTextFile(strLogPath, 8, true); + file.WriteLine(strMsg); + file.Close(); + } +} + +function main() { + // Decode command line arguments + var bDebug = false; + var bQuiet = false; + var bElevated = false; + var Args = WScript.Arguments; + for (var i = 0; i < Args.length; i++) { + if (Args(i) == "/debug") + bDebug = true; + else if (Args(i) == "/elevated") + bElevated = true; + else if (Args(i) == "/quiet") + bQuiet = true; + } + + // See if UAC is enabled + var Shell = WScript.CreateObject("Shell.Application"); + if (!bElevated && Shell.IsRestricted("System", "EnableLUA")) { + // Check that the script is being run interactively. + if (!WScript.Interactive) { + EchoError(bQuiet, "(Windows LUA) Elevation required."); + return; + } + + // Now relaunch the script, using the "RunAs" verb to elevate + var strParams = "\"" + WScript.ScriptFullName + "\""; + if (bDebug) + strParams += " /debug"; + strParams += " /elevated"; + Shell.ShellExecute(WScript.FullName, strParams, null, "RunAs"); + return; + } + + // Create shell object + var WSShell = WScript.CreateObject("WScript.Shell"); + // Create file system object + var FileSys = WScript.CreateObject("Scripting.FileSystemObject"); + + // Get the folder containing the script file + var strScriptPath = FileSys.GetParentFolderName(WScript.ScriptFullName); + if (strScriptPath == null || strScriptPath == "") + strScriptPath = "."; + + // Get the folder script files copy to + var strValue = ""; + try { + var strVCKey = "HKLM\\Software\\Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir"; + strValue = WSShell.RegRead(strVCKey); + } + catch (e) { + try { + var strVCKey_x64 = "HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir"; + strValue = WSShell.RegRead(strVCKey_x64); + } + catch (e) { + EchoError(bQuiet, "Cannot find where Visual Studio 2012 is installed."); + return; + } + } + + var strDestFolder = FileSys.BuildPath(strValue, "vcprojects"); + if (bDebug) + WScript.Echo("Destination: " + strDestFolder); + + if (!FileSys.FolderExists(strDestFolder)) { + EchoError(bQuiet, "Cannot find destination folder (should be: " + strDestFolder + ")"); + return; + } + + // Wizard Info + var nNumWizards = 1; + + var astrWizardName = new Array(); + astrWizardName[0] = "CCAppWiz.win32"; + + var nCntr; + for (nCntr = 0; nCntr < nNumWizards; nCntr++) { + var strSourceFolder = FileSys.BuildPath(strScriptPath, astrWizardName[nCntr]); + + if (bDebug) + WScript.Echo("Source: " + strSourceFolder); + + if (!FileSys.FolderExists(strSourceFolder)) { + EchoError(bQuiet, "Cannot find Wizard folder (should be: " + strSourceFolder + ")"); + return; + } + + // Copy files + try { + var strSrc = FileSys.BuildPath(strSourceFolder, astrWizardName[nCntr] + ".ico"); + var strDest = FileSys.BuildPath(strDestFolder, astrWizardName[nCntr] + ".ico"); + FileSys.CopyFile(strSrc, strDest); + + strSrc = FileSys.BuildPath(strSourceFolder, astrWizardName[nCntr] + ".vsdir"); + strDest = FileSys.BuildPath(strDestFolder, astrWizardName[nCntr] + ".vsdir"); + FileSys.CopyFile(strSrc, strDest); + } + catch (e) { + var strError = "no info"; + if (e.description.length != 0) + strError = e.description; + EchoError(bQuiet, "Cannot copy file (" + strError + ")"); + return; + } + + // Read and write CCAppWiz.vsz, add engine version and replace path when found + try { + var strSrc = FileSys.BuildPath(strSourceFolder, astrWizardName[nCntr] + ".vsz"); + var strDest = FileSys.BuildPath(strDestFolder, astrWizardName[nCntr] + ".vsz"); + + var ForReading = 1; + var fileSrc = FileSys.OpenTextFile(strSrc, ForReading); + if (fileSrc == null) { + EchoError(bQuiet, "Cannot open source file: " + strSrc); + return; + } + + var ForWriting = 2; + var fileDest = FileSys.OpenTextFile(strDest, ForWriting, true); + if (fileDest == null) { + EchoError(bQuiet, " Cannot open destination file: " + strDest); + return; + } + + while (!fileSrc.AtEndOfStream) { + var strLine = fileSrc.ReadLine(); + if (strLine.indexOf("Wizard=VsWizard.VsWizardEngine") != -1) + strLine += ".11.0"; + else if (strLine.indexOf("WIZARD_VERSION") != -1) + strLine = "Param=\"WIZARD_VERSION = 11.0\""; + else if (strLine.indexOf("ABSOLUTE_PATH") != -1) + strLine = "Param=\"ABSOLUTE_PATH = " + strSourceFolder + "\""; + fileDest.WriteLine(strLine); + } + + fileSrc.Close(); + fileDest.Close(); + } + catch (e) { + var strError = "no info"; + if (e.description.length != 0) + strError = e.description; + EchoError(bQuiet, "Cannot read and write CCAppWiz.vsz (" + strError + ")"); + return; + } + } + + // Create Cocos2d-x folder + var strDestCCFolder = ""; + try { + strDestCCFolder = FileSys.BuildPath(strDestFolder, "Cocos2d-x"); + if (!FileSys.FolderExists(strDestCCFolder)) + FileSys.CreateFolder(strDestCCFolder); + if (bDebug) + WScript.Echo("Cocos2d-x Folder: " + strDestCCFolder); + } + catch (e) { + var strError = "no info"; + if (e.description.length != 0) + strError = e.description; + EchoError(bQuiet, "Cannot create Cocos2d-x folder (" + strError + ")"); + return; + } + + // Read and write additional CCAppWiz.vsdir, add path to the wizard location + try { + var strDest = FileSys.BuildPath(strDestCCFolder, "Cocos2d-x.vsdir"); + + var ForWriting = 2; + + var fileDest = FileSys.OpenTextFile(strDest, ForWriting, true); + if (fileDest == null) { + EchoError(bQuiet, "Cannot open destination file: " + strDest); + return; + } + + var nCntr; + for (nCntr = 0; nCntr < nNumWizards; nCntr++) { + var strSourceFolder = FileSys.BuildPath(strScriptPath, astrWizardName[nCntr]); + var strSrc = FileSys.BuildPath(strSourceFolder, astrWizardName[nCntr] + ".vsdir"); + var ForReading = 1; + var fileSrc = FileSys.OpenTextFile(strSrc, ForReading); + if (fileSrc == null) { + EchoError(bQuiet, "Cannot open source file: " + strSrc); + return; + } + + while (!fileSrc.AtEndOfStream) { + var strLine = fileSrc.ReadLine(); + if (strLine.indexOf(astrWizardName[nCntr] + ".vsz|") != -1) + strLine = "..\\" + strLine; + fileDest.WriteLine(strLine); + } + + fileSrc.Close(); + } + fileDest.Close(); + } + catch (e) { + var strError = "no info"; + if (e.description.length != 0) + strError = e.description; + EchoError(bQuiet, "Cannot read and write Cocos2d-x\\CCAppWiz.vsdir (" + strError + ")"); + return; + } + + EchoInfo(bQuiet, "App Wizard successfully installed for VS2012!"); +} From 1d2b7c5b334a22824f8e5162e343df26ff197b9c Mon Sep 17 00:00:00 2001 From: trentmillar Date: Sun, 2 Sep 2012 13:23:33 -0600 Subject: [PATCH 3/4] Comment in VS2012 sln file. changed to 2012 --- cocos2d-win32.vc2012.sln | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2d-win32.vc2012.sln b/cocos2d-win32.vc2012.sln index 79ba236ca0..5160de0d46 100644 --- a/cocos2d-win32.vc2012.sln +++ b/cocos2d-win32.vc2012.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +# Visual Studio 2012 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "external\Box2D\proj.win32\Box2D.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" From f67839705f245bdf3be7355d5fa808bd7c4192a1 Mon Sep 17 00:00:00 2001 From: Trent Millar Date: Mon, 3 Sep 2012 13:18:54 -0600 Subject: [PATCH 4/4] Had wrong version in 2012 sln file. Adding clean /m to build --- build-win32.bat | 157 ++++++++++++++++++++------------------- cocos2d-win32.vc2012.sln | 94 +++++++++++++++++++++++ 2 files changed, 173 insertions(+), 78 deletions(-) diff --git a/build-win32.bat b/build-win32.bat index 68c9444dde..609b6c53ed 100644 --- a/build-win32.bat +++ b/build-win32.bat @@ -1,78 +1,79 @@ -@echo off - -echo./* -echo.* Check VC++ environment... -echo.*/ -echo. - -if defined VS110COMNTOOLS ( - set VSVARS="%VS110COMNTOOLS%vsvars32.bat" - set VC_VER=110 -) else if defined VS100COMNTOOLS ( - set VSVARS="%VS100COMNTOOLS%vsvars32.bat" - set VC_VER=100 -) else if defined VS90COMNTOOLS ( - set VSVARS="%VS90COMNTOOLS%vsvars32.bat" - set VC_VER=90 -) - -if not defined VSVARS ( - echo Can't find VC2008, VC2010 or VC2012 installed! - goto ERROR -) - -echo./* -echo.* Building cocos2d-x library binary, please wait a while... -echo.*/ -echo. - -call %VSVARS% -if %VC_VER%==90 ( - vcbuild /MP /M10 cocos2d-win32.vc2008.sln $ALL -) else if %VC_VER%==100 ( - msbuild cocos2d-win32.vc2010.sln /p:Configuration="Debug" - msbuild cocos2d-win32.vc2010.sln /p:Configuration="Release" -) else if %VC_VER%==110 ( - msbuild cocos2d-win32.vc2012.sln /p:Configuration="Debug" - msbuild cocos2d-win32.vc2012.sln /p:Configuration="Release" -) else ( - echo Script error. - goto ERROR -) - -echo./* -echo.* Check the cocos2d-win32 application "TestCpp.exe" ... -echo.*/ -echo. - -cd ".\Release.win32\" - -set CC_TEST_BIN=TestCpp.exe - -set CC_TEST_RES=..\samples\TestCpp\Resources\*.* -set CC_HELLOWORLD_RES=..\samples\HelloCpp\Resources\*.* -set CC_HELLOLUA_RES=..\samples\HelloLua\Resources\*.* -set CC_TESTJS_RES=..\samples\TestJavascript\Resources\*.* - -if not exist "%CC_TEST_BIN%" ( - echo Can't find the binary "TestCpp.exe", is there build error? - goto ERROR -) - -echo./* -echo.* Run cocos2d-win32 tests.exe and view Cocos2d-x Application Wizard for Visual Studio User Guide. -echo.*/ -echo. -xcopy /E /Y /Q "%CC_TEST_RES%" . -xcopy /E /Y /Q "%CC_HELLOWORLD_RES%" . -xcopy /E /Y /Q "%CC_HELLOLUA_RES%" . -xcopy /E /Y /Q "%CC_TESTJS_RES%" . - -call "%CC_TEST_BIN%" -start http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Cocos2d-x_Application_Wizard_for_Visual_Studio_User_Guide -goto EOF - -:ERROR -pause - -:EOF +@echo off + +echo./* +echo.* Check VC++ environment... +echo.*/ +echo. + +if defined VS110COMNTOOLS ( + set VSVARS="%VS110COMNTOOLS%vsvars32.bat" + set VC_VER=110 +) else if defined VS100COMNTOOLS ( + set VSVARS="%VS100COMNTOOLS%vsvars32.bat" + set VC_VER=100 +) else if defined VS90COMNTOOLS ( + set VSVARS="%VS90COMNTOOLS%vsvars32.bat" + set VC_VER=90 +) + +if not defined VSVARS ( + echo Can't find VC2008, VC2010 or VC2012 installed! + goto ERROR +) + +echo./* +echo.* Building cocos2d-x library binary, please wait a while... +echo.*/ +echo. + +call %VSVARS% +if %VC_VER%==90 ( + vcbuild /MP /M10 cocos2d-win32.vc2008.sln $ALL +) else if %VC_VER%==100 ( + msbuild cocos2d-win32.vc2010.sln /p:Configuration="Debug" + msbuild cocos2d-win32.vc2010.sln /p:Configuration="Release" +) else if %VC_VER%==110 ( + msbuild cocos2d-win32.vc2012.sln /t:Clean + msbuild cocos2d-win32.vc2012.sln /p:Configuration="Debug" /m + msbuild cocos2d-win32.vc2012.sln /p:Configuration="Release" /m +) else ( + echo Script error. + goto ERROR +) + +echo./* +echo.* Check the cocos2d-win32 application "TestCpp.exe" ... +echo.*/ +echo. + +cd ".\Release.win32\" + +set CC_TEST_BIN=TestCpp.exe + +set CC_TEST_RES=..\samples\TestCpp\Resources\*.* +set CC_HELLOWORLD_RES=..\samples\HelloCpp\Resources\*.* +set CC_HELLOLUA_RES=..\samples\HelloLua\Resources\*.* +set CC_TESTJS_RES=..\samples\TestJavascript\Resources\*.* + +if not exist "%CC_TEST_BIN%" ( + echo Can't find the binary "TestCpp.exe", is there build error? + goto ERROR +) + +echo./* +echo.* Run cocos2d-win32 tests.exe and view Cocos2d-x Application Wizard for Visual Studio User Guide. +echo.*/ +echo. +xcopy /E /Y /Q "%CC_TEST_RES%" . +xcopy /E /Y /Q "%CC_HELLOWORLD_RES%" . +xcopy /E /Y /Q "%CC_HELLOLUA_RES%" . +xcopy /E /Y /Q "%CC_TESTJS_RES%" . + +call "%CC_TEST_BIN%" +start http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Cocos2d-x_Application_Wizard_for_Visual_Studio_User_Guide +goto EOF + +:ERROR +pause + +:EOF diff --git a/cocos2d-win32.vc2012.sln b/cocos2d-win32.vc2012.sln index 5160de0d46..8245115887 100644 --- a/cocos2d-win32.vc2012.sln +++ b/cocos2d-win32.vc2012.sln @@ -92,3 +92,97 @@ Global HideSolutionNode = FALSE EndGlobalSection EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "external\Box2D\proj.win32\Box2D.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosDenshion", "CocosDenshion\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "cocos2dx\proj.win32\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "scripting\lua\proj.win32\liblua.vcxproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "samples\HelloLua\proj.win32\HelloLua.vcxproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp", "samples\HelloCpp\proj.win32\HelloCpp.vcxproj", "{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpp", "samples\TestCpp\proj.win32\TestCpp.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestJavascript", "samples\TestJavascript\proj.win32\TestJavascript.vcxproj", "{D0F06A44-A245-4D13-A498-0120C203B539}" + ProjectSection(ProjectDependencies) = postProject + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLua", "samples\TestLua\proj.win32\TestLua.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}" + ProjectSection(ProjectDependencies) = postProject + {21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28} + {DDC3E27F-004D-4DD4-9DD3-931A013D2159} = {DDC3E27F-004D-4DD4-9DD3-931A013D2159} + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} + {929480E7-23C0-4DF6-8456-096D71547116} = {929480E7-23C0-4DF6-8456-096D71547116} + {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} + EndProjectSection +EndProject +Global + GlobalSection(DPCodeReviewSolutionGUID) = preSolution + DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32 + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.ActiveCfg = Debug|Win32 + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32 + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32 + {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.Build.0 = Release|Win32 + {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.ActiveCfg = Debug|Win32 + {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.Build.0 = Debug|Win32 + {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.ActiveCfg = Release|Win32 + {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.Build.0 = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32 + {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.ActiveCfg = Debug|Win32 + {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.Build.0 = Debug|Win32 + {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.ActiveCfg = Release|Win32 + {DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.Build.0 = Release|Win32 + {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.ActiveCfg = Debug|Win32 + {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.Build.0 = Debug|Win32 + {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.ActiveCfg = Release|Win32 + {13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.Build.0 = Release|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.ActiveCfg = Debug|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.Build.0 = Debug|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.ActiveCfg = Release|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.Build.0 = Release|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 + {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32 + {D0F06A44-A245-4D13-A498-0120C203B539}.Debug|Win32.ActiveCfg = Debug|Win32 + {D0F06A44-A245-4D13-A498-0120C203B539}.Debug|Win32.Build.0 = Debug|Win32 + {D0F06A44-A245-4D13-A498-0120C203B539}.Release|Win32.ActiveCfg = Release|Win32 + {D0F06A44-A245-4D13-A498-0120C203B539}.Release|Win32.Build.0 = Release|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.ActiveCfg = Debug|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32 + {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.ActiveCfg = Debug|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.Build.0 = Debug|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.ActiveCfg = Release|Win32 + {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal