From 0ac3da16363b6975d3eeca94f6c96efd200ede7e Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Fri, 26 Jun 2015 21:00:32 +0800 Subject: [PATCH] Solve the error in framework-compile tools. --- .../cpp-template-default/proj.win32/main.cpp | 16 +++++++++--- .../runtime-src/proj.win32/main.cpp | 22 ++++++++++++---- .../runtime-src/proj.win32/main.cpp | 23 ++++++++++++----- tools/framework-compile/bin/gen_cocos_libs.py | 25 +++++++++++-------- .../bin/gen_libs_config.json | 22 +++------------- .../bin/template_binary_config.json | 11 +++++--- .../runtime-src/proj.win32/simulator.sln | 6 +++++ .../runtime-src/proj.win32/simulator.vcxproj | 2 ++ 8 files changed, 81 insertions(+), 46 deletions(-) diff --git a/tools/framework-compile/bin-templates/cpp-template-default/proj.win32/main.cpp b/tools/framework-compile/bin-templates/cpp-template-default/proj.win32/main.cpp index 38ae466fb6..0269ad2eee 100755 --- a/tools/framework-compile/bin-templates/cpp-template-default/proj.win32/main.cpp +++ b/tools/framework-compile/bin-templates/cpp-template-default/proj.win32/main.cpp @@ -4,9 +4,19 @@ USING_NS_CC; -#pragma comment(lib,"libcocos2d.lib") -#pragma comment(lib,"libbox2d.lib") -#pragma comment(lib,"libSpine.lib") +#if _MSC_VER > 1800 +#pragma comment(lib,"libcocos2d_2015.lib") +#pragma comment(lib,"libbox2d_2015.lib") +#pragma comment(lib,"libSpine_2015.lib") +#pragma comment(lib,"libbullet_2015.lib") +#pragma comment(lib,"librecast_2015.lib") +#else +#pragma comment(lib,"libcocos2d_2013.lib") +#pragma comment(lib,"libbox2d_2013.lib") +#pragma comment(lib,"libSpine_2013.lib") +#pragma comment(lib,"libbullet_2013.lib") +#pragma comment(lib,"librecast_2013.lib") +#endif int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, diff --git a/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/main.cpp b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/main.cpp index 9229bc26b1..2fc68f669f 100755 --- a/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/main.cpp +++ b/tools/framework-compile/bin-templates/js-template-runtime/frameworks/runtime-src/proj.win32/main.cpp @@ -2,11 +2,23 @@ #include "SimulatorWin.h" #include -#pragma comment(lib,"libcocos2d.lib") -#pragma comment(lib,"libjscocos2d.lib") -#pragma comment(lib,"libbox2d.lib") -#pragma comment(lib,"libSpine.lib") -#pragma comment(lib,"libsimulator.lib") +#if _MSC_VER > 1800 +#pragma comment(lib,"libcocos2d_2015.lib") +#pragma comment(lib,"libbox2d_2015.lib") +#pragma comment(lib,"libSpine_2015.lib") +#pragma comment(lib,"libbullet_2015.lib") +#pragma comment(lib,"librecast_2015.lib") +#pragma comment(lib,"libjscocos2d_2015.lib") +#pragma comment(lib,"libsimulator_2015.lib") +#else +#pragma comment(lib,"libcocos2d_2013.lib") +#pragma comment(lib,"libbox2d_2013.lib") +#pragma comment(lib,"libSpine_2013.lib") +#pragma comment(lib,"libbullet_2013.lib") +#pragma comment(lib,"librecast_2013.lib") +#pragma comment(lib,"libjscocos2d_2013.lib") +#pragma comment(lib,"libsimulator_2013.lib") +#endif int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, diff --git a/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/main.cpp b/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/main.cpp index ba3b237f11..cd765971c3 100755 --- a/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/main.cpp +++ b/tools/framework-compile/bin-templates/lua-template-runtime/frameworks/runtime-src/proj.win32/main.cpp @@ -2,12 +2,23 @@ #include "SimulatorWin.h" #include -#pragma comment(lib,"libcocos2d.lib") -#pragma comment(lib,"libluacocos2d.lib") -#pragma comment(lib,"libbox2d.lib") -#pragma comment(lib,"libSpine.lib") -#pragma comment(lib,"libsimulator.lib") - +#if _MSC_VER > 1800 +#pragma comment(lib,"libcocos2d_2015.lib") +#pragma comment(lib,"libbox2d_2015.lib") +#pragma comment(lib,"libSpine_2015.lib") +#pragma comment(lib,"libbullet_2015.lib") +#pragma comment(lib,"librecast_2015.lib") +#pragma comment(lib,"libluacocos2d_2015.lib") +#pragma comment(lib,"libsimulator_2015.lib") +#else +#pragma comment(lib,"libcocos2d_2013.lib") +#pragma comment(lib,"libbox2d_2013.lib") +#pragma comment(lib,"libSpine_2013.lib") +#pragma comment(lib,"libbullet_2013.lib") +#pragma comment(lib,"librecast_2013.lib") +#pragma comment(lib,"libluacocos2d_2013.lib") +#pragma comment(lib,"libsimulator_2013.lib") +#endif int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, diff --git a/tools/framework-compile/bin/gen_cocos_libs.py b/tools/framework-compile/bin/gen_cocos_libs.py index 04b03a8ca0..73602aa66e 100755 --- a/tools/framework-compile/bin/gen_cocos_libs.py +++ b/tools/framework-compile/bin/gen_cocos_libs.py @@ -128,8 +128,21 @@ class CocosLibsCompiler(object): # get the VS projects info win32_proj_info = self.cfg_info[CocosLibsCompiler.KEY_VS_PROJS_INFO] - for vs_version in vs_cmd_info.keys(): + for vs_version in compile_vs_versions: + if not vs_version in vs_cmd_info.keys(): + continue + vs_command = vs_cmd_info[vs_version] + for key in win32_proj_info.keys(): + # clean solutions + proj_path = os.path.join(self.repo_x, key) + clean_cmd = " ".join([ + "\"%s\"" % vs_command, + "\"%s\"" % proj_path, + "/clean \"Release|Win32\"" + ]) + utils_cocos.execute_command(clean_cmd) + for key in win32_proj_info.keys(): output_dir = os.path.join(self.lib_dir, "win32") proj_path = os.path.join(self.repo_x, key) @@ -140,14 +153,6 @@ class CocosLibsCompiler(object): if not os.path.exists(win32_output_dir): os.makedirs(win32_output_dir) - # clean solution - # clean_cmd = " ".join([ - # "\"%s\"" % vs_command, - # "\"%s\"" % proj_path, - # "/clean \"Release|Win32\"" - # ]) - # utils_cocos.execute_command(clean_cmd) - # build project if self.use_incredibuild: # use incredibuild, build whole sln @@ -354,7 +359,7 @@ if __name__ == "__main__": parser.add_argument('--mac', dest='mac', action="store_true", help='compile mac platform') parser.add_argument('--android', dest='android', action="store_true",help='complile android platform') parser.add_argument('--dis-strip', "--disable-strip", dest='disable_strip', action="store_true", help='Disable the strip of the generated libs.') - parser.add_argument('--vs', dest='vs_version', type=int, help='visual studio version, such as 2013.', default=2013) + parser.add_argument('--vs', dest='vs_version', type=int, help='visual studio version, such as 2013.', default=None) parser.add_argument("--app-abi", dest="app_abi", help="Set the APP_ABI of ndk-build.Can be multi value separated with ':'. Sample : --app-aib armeabi:x86:mips. Default value is 'armeabi'.") diff --git a/tools/framework-compile/bin/gen_libs_config.json b/tools/framework-compile/bin/gen_libs_config.json index f9abbca41c..48eebcc034 100755 --- a/tools/framework-compile/bin/gen_libs_config.json +++ b/tools/framework-compile/bin/gen_libs_config.json @@ -15,30 +15,16 @@ } }, "vs_projs_info" : { - "build/cocos2d-win32.sln" : { - "build_targets" : [ - "libluacocos2d" - ], - "rename_targets" : [ - "libcocos2d", "libluacocos2d", "libSpine", "libbox2d" - ] - }, - "build/cocos2d-js-win32.sln" : { - "build_targets" : [ - "libjscocos2d" - ], - "rename_targets" : [ - "libjscocos2d" - ] - }, "tools/simulator/frameworks/runtime-src/proj.win32/simulator.sln" : { "build_targets" : [ - "libsimulator" + "simulator" ], "rename_targets" : [ + "libSpine", "libbox2d", "libbullet", "librecast", + "libcocos2d", "libluacocos2d", "libjscocos2d", "libsimulator" ] } }, - "support_vs_versions" : [ 2013, 2015 ] + "support_vs_versions" : [ 2015, 2013 ] } diff --git a/tools/framework-compile/bin/template_binary_config.json b/tools/framework-compile/bin/template_binary_config.json index 2f7a2a988d..dfe5b49ba2 100755 --- a/tools/framework-compile/bin/template_binary_config.json +++ b/tools/framework-compile/bin/template_binary_config.json @@ -4,6 +4,8 @@ "from": "templates/cpp-template-default", "to": "cpp-template-binary", "exclude": [ + "*android-studio", + "*win10", "*wp8", "*win8.1-universal", "*linux", @@ -25,6 +27,8 @@ "from": "templates/lua-template-default/frameworks", "to": "lua-template-binary/frameworks", "exclude": [ + "*android-studio", + "*win10", "*wp8", "*win8.1-universal", "*linux", @@ -42,6 +46,8 @@ "from": "templates/js-template-runtime", "to": "js-template-binary", "exclude": [ + "*android-studio", + "*win10", "*wp8", "*win8.1-universal", "*linux", @@ -52,10 +58,7 @@ }, { "from": "web", - "to": "js-template-binary/frameworks/cocos2d-html5", - "exclude": [ - ".*" - ] + "to": "js-template-binary/frameworks/cocos2d-html5" }, { "from": "tools/simulator/frameworks/runtime-src/Classes/ide-support", diff --git a/tools/simulator/frameworks/runtime-src/proj.win32/simulator.sln b/tools/simulator/frameworks/runtime-src/proj.win32/simulator.sln index e81b11e41c..1e67890410 100644 --- a/tools/simulator/frameworks/runtime-src/proj.win32/simulator.sln +++ b/tools/simulator/frameworks/runtime-src/proj.win32/simulator.sln @@ -22,6 +22,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjscocos2d", "..\..\..\.. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet", "..\..\..\..\..\external\bullet\proj.win32\libbullet.vcxproj", "{012DFF48-A13F-4F52-B07B-F8B9D21CE95B}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librecast", "..\..\..\..\..\external\recast\proj.win32\librecast.vcxproj", "{41E34993-647E-4282-8384-4AB1AE31A452}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -60,6 +62,10 @@ Global {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Debug|Win32.Build.0 = Debug|Win32 {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Release|Win32.ActiveCfg = Release|Win32 {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Release|Win32.Build.0 = Release|Win32 + {41E34993-647E-4282-8384-4AB1AE31A452}.Debug|Win32.ActiveCfg = Debug|Win32 + {41E34993-647E-4282-8384-4AB1AE31A452}.Debug|Win32.Build.0 = Debug|Win32 + {41E34993-647E-4282-8384-4AB1AE31A452}.Release|Win32.ActiveCfg = Release|Win32 + {41E34993-647E-4282-8384-4AB1AE31A452}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj b/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj index cb6d726a63..3123402c14 100644 --- a/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj +++ b/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj @@ -91,6 +91,7 @@ libcurl_imp.lib;websockets.lib;mozjs-33.lib;%(AdditionalDependencies) $(ProjectDir)../../../runtime/win32/$(TargetName).pdb $(ProjectDir)../../../runtime/win32/$(TargetName)$(TargetExt) + libcmt.lib;%(IgnoreSpecificDefaultLibraries) 0x0409 @@ -156,6 +157,7 @@ xcopy /Y /Q "$(OutDir)lang" "$(ProjectDir)..\..\..\runtime\win32" libcurl_imp.lib;websockets.lib;mozjs-33.lib;%(AdditionalDependencies) false $(OutDir)$(ProjectName).exe + libcmt.lib;%(IgnoreSpecificDefaultLibraries) 0x0409