Skip to content

Commit

Permalink
fixed cocos2d#300 Cocos2d-win32 application wizard for vs ok.
Browse files Browse the repository at this point in the history
  • Loading branch information
yangws committed Mar 10, 2011
1 parent 1c6ee33 commit a0e616d
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 23 deletions.
6 changes: 3 additions & 3 deletions HelloWorld/win32/HelloWorld.win32.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libcocos2d.lib libPlatformSupport.lib"
AdditionalDependencies="libcocos2d.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="2"
AdditionalLibraryDirectories="$(OutDir)"
Expand Down Expand Up @@ -119,7 +119,7 @@
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="&quot;$(SolutionDir)platform_support\include&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)platform_support\third_party\win32\OGLES&quot;;..\;.\"
AdditionalIncludeDirectories="&quot;$(SolutionDir)cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\;.\"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
Expand All @@ -138,7 +138,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libcocos2d.lib libPlatformSupport.lib"
AdditionalDependencies="libcocos2d.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="$(OutDir)"
Expand Down
67 changes: 67 additions & 0 deletions build-win32.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
@echo off

echo./*
echo.* Check VC++ environment...
echo.*/
echo.

if defined VS90COMNTOOLS (
set VSVARS="%VS90COMNTOOLS%vsvars32.bat"
) else (
if defined VS100COMNTOOLS (
set VSVARS="%VS100COMNTOOLS%vsvars32.bat"
)
)

if not defined VSVARS (
echo Can't find VC2008 or VC2010 installed!
goto ERROR
)

echo./*
echo.* Building cocos2d-x library binary, please wait a while...
echo.*/
echo.

call %VSVARS%
vcbuild cocos2d-win32.sln $ALL

echo./*
echo.* Check the cocos2d-win32 application "tests.exe" ...
echo.*/
echo.

set CC_TEST_PATH=".\Release.win32\tests.exe"
if not exist %CC_TEST_PATH% (
echo Can't find the binary "tests.exe", is there build error?
goto ERROR
)

echo./*
echo.* Install Cocos2d-win32 application wizard...
echo.*/
echo.

set SCRIPT_LOG=InstallWizardLog.txt
set SCRIPT_DIR=.\template\CCApplicationWizard.vs\

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.* Run cocos2d-win32 tests.exe and view Cocos2d-x Application Wizard for Visual Studio User Guide.
echo.*/
echo.
call %CC_TEST_PATH%
start http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Cocos2d-x_Application_Wizard_for_Visual_Studio_User_Guide
goto EOF

:ERROR
pause

:EOF
13 changes: 9 additions & 4 deletions cocos2dx/proj.win32/cocos2d-win32.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
Expand All @@ -41,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\iconv&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\zlib&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libpng&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libjpeg&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libxml2&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\include;..\"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\iconv&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\zlib&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libpng&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libjpeg&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libxml2&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\include;.."
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Expand All @@ -60,6 +61,7 @@
/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="if not exist $(OutDir) mkdir $(OutDir)&#x0D;&#x0A;xcopy /Y /Q $(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.* $(OutDir)"
/>
<Tool
Name="VCLinkerTool"
Expand All @@ -68,7 +70,7 @@
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;"
IgnoreAllDefaultLibraries="false"
IgnoreDefaultLibraryNames="MSVCRT.lib;LIBCMTD.lib"
IgnoreDefaultLibraryNames=" "
GenerateDebugInformation="true"
SubSystem="2"
ImportLibrary="$(TargetDir)$(TargetName).lib"
Expand Down Expand Up @@ -106,6 +108,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
Expand All @@ -121,7 +124,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)platform_support\include&quot;;&quot;$(SolutionDir)platform_support\third_party\win32\iconv&quot;;&quot;$(SolutionDir)platform_support\third_party\win32\zlib&quot;;&quot;$(SolutionDir)platform_support\third_party\win32\libpng&quot;;&quot;$(SolutionDir)platform_support\third_party\win32\libjpeg&quot;;&quot;$(SolutionDir)platform_support\third_party\win32\libxml2&quot;;&quot;$(SolutionDir)platform_support\third_party\win32\OGLES&quot;;..\include;..\"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\iconv&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\zlib&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libpng&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libjpeg&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libxml2&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\include;.."
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Expand All @@ -138,13 +141,15 @@
/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="if not exist $(OutDir) mkdir $(OutDir)&#x0D;&#x0A;xcopy /Y /Q $(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.* $(OutDir)"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libEGL.lib libgles_cm.lib libxml2.lib libzlib.lib libpng.lib libjpeg.lib libiconv.lib libPlatformSupport.lib"
AdditionalDependencies="libEGL.lib libgles_cm.lib libxml2.lib libzlib.lib libpng.lib libjpeg.lib libiconv.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;"
IgnoreDefaultLibraryNames=" "
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function AddConfigurations(proj, strProjectName) {

// Additional Inlcude Directories
var strAddIncludeDir = '.;.\\win32;.\\Classes';
strAddIncludeDir += ';..\\cocos2dx\\include';
strAddIncludeDir += ';..\\cocos2dx;..\\cocos2dx\\include';
strAddIncludeDir += ';..\\cocos2dx\\platform';
strAddIncludeDir += ';..\\cocos2dx\\platform\\third_party\\win32\\OGLES';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,5 @@ function main() {
return;
}

if (! bQuiet) {
WScript.Echo("App Wizard successfully installed!");
}
EchoError(bQuiet, "App Wizard successfully installed for VC2008 Express!");
}
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,5 @@ function main() {
return;
}

if (! bQuiet) {
WScript.Echo("App Wizard successfully installed!");
}
EchoError(bQuiet, "App Wizard successfully installed for VC2010 Express!");
}
4 changes: 1 addition & 3 deletions template/CCApplicationWizard.vs/InstallWizardForVS2008.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,5 @@ function main() {
return;
}

if (! bQuiet) {
WScript.Echo("App Wizard successfully installed!");
}
EchoError(bQuiet, "App Wizard successfully installed for VS2008!");
}
4 changes: 1 addition & 3 deletions template/CCApplicationWizard.vs/InstallWizardForVS2010.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,5 @@ function main() {
return;
}

if (! bQuiet) {
WScript.Echo("App Wizard successfully installed!");
}
EchoError(bQuiet, "App Wizard successfully installed for VS2010!");
}
6 changes: 3 additions & 3 deletions tests/test.win32/test.win32.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libcocos2d.lib libPlatformSupport.lib libgles_cm.lib libBox2d.lib libchipmunk.lib"
AdditionalDependencies="libcocos2d.lib libgles_cm.lib libBox2d.lib libchipmunk.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;"
Expand Down Expand Up @@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="&quot;$(SolutionDir)platform_support\include&quot;;&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)chipmunk\include\chipmunk&quot;;&quot;$(SolutionDir)CocosDenshion\include&quot;;..\tests;&quot;$(SolutionDir)platform_support\third_party\win32\OGLES&quot;;..\;.\"
AdditionalIncludeDirectories="&quot;$(SolutionDir)cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)chipmunk\include\chipmunk&quot;;&quot;$(SolutionDir)CocosDenshion\include&quot;;..\tests;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\;.\"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
Expand All @@ -140,7 +140,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libcocos2d.lib libPlatformSupport.lib libgles_cm.lib libBox2d.lib libchipmunk.lib"
AdditionalDependencies="libcocos2d.lib libgles_cm.lib libBox2d.lib libchipmunk.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;"
Expand Down

0 comments on commit a0e616d

Please sign in to comment.