diff --git a/build/android-build.py b/build/android-build.py index 0309cf008b..3b36ea0424 100755 --- a/build/android-build.py +++ b/build/android-build.py @@ -16,11 +16,18 @@ def get_num_of_cpu(): ''' The build process can be accelerated by running multiple concurrent job processes using the -j-option. ''' try: - from numpy.distutils import cpuinfo - return cpuinfo.cpu._getNCPUs() + platform = sys.platform + if platform == 'win32': + if 'NUMBER_OF_PROCESSORS' in os.environ: + return int(os.environ['NUMBER_OF_PROCESSORS']) + else: + return 1 + else: + from numpy.distutils import cpuinfo + return cpuinfo.cpu._getNCPUs() except Exception: print "Can't know cpuinfo, use default 1 cpu" - return 1 + return 1 def check_environment_variables(): ''' Checking the environment NDK_ROOT, which will be used for building diff --git a/cocos/network/proj.win32/libNetwork.vcxproj b/cocos/network/proj.win32/libNetwork.vcxproj index 088538dfed..761ab39423 100644 --- a/cocos/network/proj.win32/libNetwork.vcxproj +++ b/cocos/network/proj.win32/libNetwork.vcxproj @@ -80,7 +80,7 @@ Disabled $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;..\Include;$(EngineRoot)cocos;$(EngineRoot)external\websockets\include\win32;$(EngineRoot)external\curl\include\win32;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL diff --git a/template/multi-platform-cpp/proj.android/build_native.py b/template/multi-platform-cpp/proj.android/build_native.py index c702b81a85..13a3b37555 100755 --- a/template/multi-platform-cpp/proj.android/build_native.py +++ b/template/multi-platform-cpp/proj.android/build_native.py @@ -12,11 +12,18 @@ def get_num_of_cpu(): ''' The build process can be accelerated by running multiple concurrent job processes using the -j-option. ''' try: - from numpy.distutils import cpuinfo - return cpuinfo.cpu._getNCPUs() + platform = sys.platform + if platform == 'win32': + if 'NUMBER_OF_PROCESSORS' in os.environ: + return int(os.environ['NUMBER_OF_PROCESSORS']) + else: + return 1 + else: + from numpy.distutils import cpuinfo + return cpuinfo.cpu._getNCPUs() except Exception: print "Can't know cpuinfo, use default 1 cpu" - return 1 + return 1 def check_environment_variables_sdk(): ''' Checking the environment ANDROID_SDK_ROOT, which will be used for building diff --git a/template/multi-platform-js/proj.android/build_native.py b/template/multi-platform-js/proj.android/build_native.py index 42dd3aa9b6..561a0e8981 100755 --- a/template/multi-platform-js/proj.android/build_native.py +++ b/template/multi-platform-js/proj.android/build_native.py @@ -12,11 +12,18 @@ def get_num_of_cpu(): ''' The build process can be accelerated by running multiple concurrent job processes using the -j-option. ''' try: - from numpy.distutils import cpuinfo - return cpuinfo.cpu._getNCPUs() + platform = sys.platform + if platform == 'win32': + if 'NUMBER_OF_PROCESSORS' in os.environ: + return int(os.environ['NUMBER_OF_PROCESSORS']) + else: + return 1 + else: + from numpy.distutils import cpuinfo + return cpuinfo.cpu._getNCPUs() except Exception: print "Can't know cpuinfo, use default 1 cpu" - return 1 + return 1 def check_environment_variables_sdk(): ''' Checking the environment ANDROID_SDK_ROOT, which will be used for building diff --git a/template/multi-platform-lua/proj.android/build_native.py b/template/multi-platform-lua/proj.android/build_native.py index b6920e2bbe..f5d485da07 100755 --- a/template/multi-platform-lua/proj.android/build_native.py +++ b/template/multi-platform-lua/proj.android/build_native.py @@ -12,11 +12,18 @@ def get_num_of_cpu(): ''' The build process can be accelerated by running multiple concurrent job processes using the -j-option. ''' try: - from numpy.distutils import cpuinfo - return cpuinfo.cpu._getNCPUs() + platform = sys.platform + if platform == 'win32': + if 'NUMBER_OF_PROCESSORS' in os.environ: + return int(os.environ['NUMBER_OF_PROCESSORS']) + else: + return 1 + else: + from numpy.distutils import cpuinfo + return cpuinfo.cpu._getNCPUs() except Exception: print "Can't know cpuinfo, use default 1 cpu" - return 1 + return 1 def check_environment_variables_sdk(): ''' Checking the environment ANDROID_SDK_ROOT, which will be used for building