diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index a0d453c00a..e38f421a89 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -1,25 +1,42 @@ +set(CC_PLATFORM_MAC_IOS 1) +set(CC_PLATFORM_WINDOWS 2) +set(CC_PLATFORM_ANDROID 3) +set(CC_PLATFORM_MAC_OSX 4) +set(CC_PLATFORM 1) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(WINDOWS TRUE) set(PLATFORM_FOLDER win32) + set(CC_PLATFORM ${CC_PLATFORM_WINDOWS}) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android") set(PLATFORM_FOLDER android) set(ANDROID TRUE) + set(CC_PLATFORM ${CC_PLATFORM_ANDROID}) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(APPLE TRUE) set(MACOSX TRUE) set(PLATFORM_FOLDER mac) + set(CC_PLATFORM ${CC_PLATFORM_MAC_OSX}) elseif(${CMAKE_SYSTEM_NAME} MATCHES "iOS") set(APPLE TRUE) set(IOS TRUE) set(PLATFORM_FOLDER ios) + set(CC_PLATFORM ${CC_PLATFORM_MAC_IOS}) else() message(FATAL_ERROR "Unsupported platform, CMake will exit") return() endif() +# platform macros + +add_definitions(-DCC_PLATFORM_WINDOWS=${CC_PLATFORM_WINDOWS} ) +add_definitions(-DCC_PLATFORM_MAC_OSX=${CC_PLATFORM_MAC_OSX} ) +add_definitions(-DCC_PLATFORM_MAC_IOS=${CC_PLATFORM_MAC_IOS} ) +add_definitions(-DCC_PLATFORM_ANDROID=${CC_PLATFORM_ANDROID} ) +add_definitions(-DCC_PLATFORM=${CC_PLATFORM}) + # generators that are capable of organizing into a hierarchy of folders set_property(GLOBAL PROPERTY USE_FOLDERS ON) # simplify generator condition, please use them everywhere @@ -353,7 +370,6 @@ cocos_source_files( cocos/platform/CCFileUtils.h cocos/platform/CCImage.cpp cocos/platform/CCImage.h - cocos/platform/CCPlatformConfig.h cocos/platform/CCPlatformDefine.h cocos/platform/CCSAXParser.cpp cocos/platform/CCSAXParser.h diff --git a/native/cocos/audio/AudioEngine.cpp b/native/cocos/audio/AudioEngine.cpp index 3a3c46cfeb..0ac387c97a 100644 --- a/native/cocos/audio/AudioEngine.cpp +++ b/native/cocos/audio/AudioEngine.cpp @@ -23,8 +23,6 @@ THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" - #include "audio/include/AudioEngine.h" #include "platform/CCFileUtils.h" #include "base/ccUtils.h" diff --git a/native/cocos/audio/apple/AudioCache.h b/native/cocos/audio/apple/AudioCache.h index 3c79058eea..2770398c53 100644 --- a/native/cocos/audio/apple/AudioCache.h +++ b/native/cocos/audio/apple/AudioCache.h @@ -25,7 +25,6 @@ #pragma once -#include "platform/CCPlatformConfig.h" #if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #import diff --git a/native/cocos/audio/apple/AudioCache.mm b/native/cocos/audio/apple/AudioCache.mm index 5c803562f5..9e5677ab69 100644 --- a/native/cocos/audio/apple/AudioCache.mm +++ b/native/cocos/audio/apple/AudioCache.mm @@ -25,7 +25,6 @@ #define LOG_TAG "AudioCache" -#include "platform/CCPlatformConfig.h" #if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "audio/apple/AudioCache.h" diff --git a/native/cocos/audio/apple/AudioEngine-inl.h b/native/cocos/audio/apple/AudioEngine-inl.h index ca1efe3023..d8ecef8275 100644 --- a/native/cocos/audio/apple/AudioEngine-inl.h +++ b/native/cocos/audio/apple/AudioEngine-inl.h @@ -23,7 +23,6 @@ THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" #if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #ifndef __AUDIO_ENGINE_INL_H_ diff --git a/native/cocos/audio/apple/AudioEngine-inl.mm b/native/cocos/audio/apple/AudioEngine-inl.mm index 73396dcea3..578adf4f08 100644 --- a/native/cocos/audio/apple/AudioEngine-inl.mm +++ b/native/cocos/audio/apple/AudioEngine-inl.mm @@ -25,7 +25,7 @@ #define LOG_TAG "AudioEngine-inl.mm" -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "audio/apple/AudioEngine-inl.h" diff --git a/native/cocos/audio/apple/AudioPlayer.h b/native/cocos/audio/apple/AudioPlayer.h index b784c6aacc..03e999e3e3 100644 --- a/native/cocos/audio/apple/AudioPlayer.h +++ b/native/cocos/audio/apple/AudioPlayer.h @@ -25,7 +25,7 @@ #pragma once -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "base/ccMacros.h" diff --git a/native/cocos/audio/apple/AudioPlayer.mm b/native/cocos/audio/apple/AudioPlayer.mm index 9aab72b932..ed63a748f5 100644 --- a/native/cocos/audio/apple/AudioPlayer.mm +++ b/native/cocos/audio/apple/AudioPlayer.mm @@ -25,7 +25,7 @@ #define LOG_TAG "AudioPlayer" -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #import diff --git a/native/cocos/audio/include/AudioEngine.h b/native/cocos/audio/include/AudioEngine.h index f007a18b62..4f7fed99ba 100644 --- a/native/cocos/audio/include/AudioEngine.h +++ b/native/cocos/audio/include/AudioEngine.h @@ -25,7 +25,7 @@ #pragma once -#include "platform/CCPlatformConfig.h" + #include "base/ccMacros.h" #include "audio/include/Export.h" diff --git a/native/cocos/audio/win32/AudioCache.cpp b/native/cocos/audio/win32/AudioCache.cpp index b90871a05a..1f40cd4eca 100644 --- a/native/cocos/audio/win32/AudioCache.cpp +++ b/native/cocos/audio/win32/AudioCache.cpp @@ -25,7 +25,7 @@ #define LOG_TAG "AudioCache" -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/audio/win32/AudioCache.h b/native/cocos/audio/win32/AudioCache.h index b884b6cb2d..1f3446fb49 100644 --- a/native/cocos/audio/win32/AudioCache.h +++ b/native/cocos/audio/win32/AudioCache.h @@ -25,7 +25,7 @@ #pragma once -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/audio/win32/AudioEngine-win32.cpp b/native/cocos/audio/win32/AudioEngine-win32.cpp index f5c4b763c7..6cd5db8a4b 100644 --- a/native/cocos/audio/win32/AudioEngine-win32.cpp +++ b/native/cocos/audio/win32/AudioEngine-win32.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #define LOG_TAG "AudioEngine-Win32" -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/audio/win32/AudioEngine-win32.h b/native/cocos/audio/win32/AudioEngine-win32.h index 57a2dc50b7..df7fa03a96 100644 --- a/native/cocos/audio/win32/AudioEngine-win32.h +++ b/native/cocos/audio/win32/AudioEngine-win32.h @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/audio/win32/AudioPlayer.cpp b/native/cocos/audio/win32/AudioPlayer.cpp index 3fb961b32f..57a0f31c69 100644 --- a/native/cocos/audio/win32/AudioPlayer.cpp +++ b/native/cocos/audio/win32/AudioPlayer.cpp @@ -25,7 +25,7 @@ #define LOG_TAG "AudioPlayer" -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "audio/win32/AudioPlayer.h" diff --git a/native/cocos/audio/win32/AudioPlayer.h b/native/cocos/audio/win32/AudioPlayer.h index 32c4a91748..4311f80349 100644 --- a/native/cocos/audio/win32/AudioPlayer.h +++ b/native/cocos/audio/win32/AudioPlayer.h @@ -25,7 +25,6 @@ #pragma once -#include "platform/CCPlatformConfig.h" #if CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/base/ccConfig.h b/native/cocos/base/ccConfig.h index 65512e7cf0..5f55db89b0 100644 --- a/native/cocos/base/ccConfig.h +++ b/native/cocos/base/ccConfig.h @@ -29,7 +29,7 @@ THE SOFTWARE. #ifndef __CCCONFIG_H__ #define __CCCONFIG_H__ -#include "platform/CCPlatformConfig.h" + /** * @file diff --git a/native/cocos/cocos2d.h b/native/cocos/cocos2d.h index 5a7eef8d85..77a4c8b9a3 100644 --- a/native/cocos/cocos2d.h +++ b/native/cocos/cocos2d.h @@ -73,7 +73,6 @@ THE SOFTWARE. #include "platform/CCDevice.h" #include "platform/CCFileUtils.h" #include "platform/CCImage.h" -#include "platform/CCPlatformConfig.h" #include "base/ccMacros.h" #include "platform/CCSAXParser.h" #include "platform/CCCanvasRenderingContext2D.h" diff --git a/native/cocos/network/HttpAsynConnection-apple.h b/native/cocos/network/HttpAsynConnection-apple.h index 5e1b00db3e..f8d87d9bbb 100644 --- a/native/cocos/network/HttpAsynConnection-apple.h +++ b/native/cocos/network/HttpAsynConnection-apple.h @@ -27,7 +27,7 @@ #define __HTTPASYNCONNECTION_H__ /// @cond DO_NOT_SHOW -#include "platform/CCPlatformConfig.h" + #if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) || (CC_PLATFORM == CC_PLATFORM_MAC_IOS) #import diff --git a/native/cocos/network/HttpAsynConnection-apple.m b/native/cocos/network/HttpAsynConnection-apple.m index 206d5590d4..6648abd417 100755 --- a/native/cocos/network/HttpAsynConnection-apple.m +++ b/native/cocos/network/HttpAsynConnection-apple.m @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" + #if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) || (CC_PLATFORM == CC_PLATFORM_MAC_IOS) #import "network/HttpAsynConnection-apple.h" diff --git a/native/cocos/network/HttpClient-android.cpp b/native/cocos/network/HttpClient-android.cpp index e51a102797..b3eb38de75 100644 --- a/native/cocos/network/HttpClient-android.cpp +++ b/native/cocos/network/HttpClient-android.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" + #if (CC_PLATFORM == CC_PLATFORM_ANDROID) #include "network/HttpClient.h" diff --git a/native/cocos/platform/CCApplication.h b/native/cocos/platform/CCApplication.h index 3926683116..29e1e697ec 100644 --- a/native/cocos/platform/CCApplication.h +++ b/native/cocos/platform/CCApplication.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include #include // // std::this_thread::sleep_for #include "base/ccMacros.h" -#include "platform/CCPlatformConfig.h" + #include "platform/CCPlatformDefine.h" #include "scripting/js-bindings/event/EventDispatcher.h" #include "base/CCScheduler.h" diff --git a/native/cocos/platform/CCPlatformConfig.h b/native/cocos/platform/CCPlatformConfig.h deleted file mode 100644 index 799b3ee095..0000000000 --- a/native/cocos/platform/CCPlatformConfig.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#pragma once - -/// @cond DO_NOT_SHOW - -// Initial platform stuff to set. -#define CC_PLATFORM_WINDOWS 1 -#define CC_PLATFORM_LINUX 2 -#define CC_PLATFORM_MAC_OSX 3 -#define CC_PLATFORM_MAC_IOS 4 -#define CC_PLATFORM_ANDROID 5 -#define CC_PLATFORM_NACL 6 - -// Platform recognition -#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(_WIN64) || defined(__WIN64__) || defined(WIN64) -# define CC_PLATFORM CC_PLATFORM_WINDOWS -#elif defined(__APPLE_CC__) -// Device Simulator -// Both requiring OS version 4.0 or greater -# if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 -# define CC_PLATFORM CC_PLATFORM_MAC_IOS -# else -# define CC_PLATFORM CC_PLATFORM_MAC_OSX -# endif -#elif defined(__ANDROID__) -# define CC_PLATFORM CC_PLATFORM_ANDROID -#elif defined(linux) || defined(__linux) || defined(__linux__) -# define CC_PLATFORM CC_PLATFORM_LINUX -#elif defined(__native_client__) -# define CC_PLATFORM CC_PLATFORM_NACL -#else -# error "Couldn't recognize platform" -#endif - -#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) -#ifndef __MINGW32__ -#pragma warning (disable:4127) -#endif -#endif - -/// @endcond diff --git a/native/cocos/platform/CCPlatformDefine.h b/native/cocos/platform/CCPlatformDefine.h index efefbee7e2..7462e8c8fc 100644 --- a/native/cocos/platform/CCPlatformDefine.h +++ b/native/cocos/platform/CCPlatformDefine.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __PLATFORM_CCPLATFORMDEFINE_H__ /// @cond DO_NOT_SHOW -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "platform/mac/CCPlatformDefine-mac.h" diff --git a/native/cocos/platform/CCSAXParser.h b/native/cocos/platform/CCSAXParser.h index 8a443c1e96..3e0f08bd6d 100644 --- a/native/cocos/platform/CCSAXParser.h +++ b/native/cocos/platform/CCSAXParser.h @@ -27,7 +27,7 @@ #define __CCSAXPARSER_H__ /// @cond DO_NOT_SHOW -#include "platform/CCPlatformConfig.h" + #include "base/ccMacros.h" #include diff --git a/native/cocos/platform/CCStdC.h b/native/cocos/platform/CCStdC.h index 7c60c5c233..4c2fabd9ee 100644 --- a/native/cocos/platform/CCStdC.h +++ b/native/cocos/platform/CCStdC.h @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #pragma once -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/platform/android/CCDevice-android.cpp b/native/cocos/platform/android/CCDevice-android.cpp index f963e64302..9c09d499b8 100644 --- a/native/cocos/platform/android/CCDevice-android.cpp +++ b/native/cocos/platform/android/CCDevice-android.cpp @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_ANDROID #include "platform/CCDevice.h" diff --git a/native/cocos/platform/android/CCFileUtils-android.cpp b/native/cocos/platform/android/CCFileUtils-android.cpp index 613cc8a8ff..9afea0239b 100644 --- a/native/cocos/platform/android/CCFileUtils-android.cpp +++ b/native/cocos/platform/android/CCFileUtils-android.cpp @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_ANDROID #include "platform/android/CCFileUtils-android.h" diff --git a/native/cocos/platform/android/CCFileUtils-android.h b/native/cocos/platform/android/CCFileUtils-android.h index 7b3848c0eb..57aa30717f 100644 --- a/native/cocos/platform/android/CCFileUtils-android.h +++ b/native/cocos/platform/android/CCFileUtils-android.h @@ -26,7 +26,7 @@ Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. #ifndef __CC_FILEUTILS_ANDROID_H__ #define __CC_FILEUTILS_ANDROID_H__ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_ANDROID #include "platform/CCFileUtils.h" diff --git a/native/cocos/platform/android/CCPlatformDefine-android.h b/native/cocos/platform/android/CCPlatformDefine-android.h index 54101a1623..d1abda4198 100644 --- a/native/cocos/platform/android/CCPlatformDefine-android.h +++ b/native/cocos/platform/android/CCPlatformDefine-android.h @@ -27,7 +27,7 @@ THE SOFTWARE. #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_ANDROID #include diff --git a/native/cocos/platform/ios/CCImage-ios.mm b/native/cocos/platform/ios/CCImage-ios.mm index 72f5eb09f4..82363df427 100644 --- a/native/cocos/platform/ios/CCImage-ios.mm +++ b/native/cocos/platform/ios/CCImage-ios.mm @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_MAC_IOS #import "platform/CCImage.h" diff --git a/native/cocos/platform/ios/CCPlatformDefine-ios.h b/native/cocos/platform/ios/CCPlatformDefine-ios.h index 0d4aca35ce..058d69653d 100644 --- a/native/cocos/platform/ios/CCPlatformDefine-ios.h +++ b/native/cocos/platform/ios/CCPlatformDefine-ios.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_MAC_IOS #include diff --git a/native/cocos/platform/mac/CCDevice-mac.mm b/native/cocos/platform/mac/CCDevice-mac.mm index 121c34b4ba..1491997ad4 100644 --- a/native/cocos/platform/mac/CCDevice-mac.mm +++ b/native/cocos/platform/mac/CCDevice-mac.mm @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "platform/CCDevice.h" diff --git a/native/cocos/platform/mac/CCPlatformDefine-mac.h b/native/cocos/platform/mac/CCPlatformDefine-mac.h index 7561727668..90c01ab4da 100644 --- a/native/cocos/platform/mac/CCPlatformDefine-mac.h +++ b/native/cocos/platform/mac/CCPlatformDefine-mac.h @@ -27,7 +27,7 @@ THE SOFTWARE. #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_MAC_OSX #include diff --git a/native/cocos/platform/win32/CCDevice-win32.cpp b/native/cocos/platform/win32/CCDevice-win32.cpp index 94cd665f35..4081665fd6 100644 --- a/native/cocos/platform/win32/CCDevice-win32.cpp +++ b/native/cocos/platform/win32/CCDevice-win32.cpp @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "platform/CCDevice.h" diff --git a/native/cocos/platform/win32/CCFileUtils-win32.cpp b/native/cocos/platform/win32/CCFileUtils-win32.cpp index 080514e91b..9b0dfe9f4e 100644 --- a/native/cocos/platform/win32/CCFileUtils-win32.cpp +++ b/native/cocos/platform/win32/CCFileUtils-win32.cpp @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "platform/win32/CCFileUtils-win32.h" diff --git a/native/cocos/platform/win32/CCFileUtils-win32.h b/native/cocos/platform/win32/CCFileUtils-win32.h index d7ef087905..1cf2451f04 100644 --- a/native/cocos/platform/win32/CCFileUtils-win32.h +++ b/native/cocos/platform/win32/CCFileUtils-win32.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CC_FILEUTILS_WIN32_H__ #define __CC_FILEUTILS_WIN32_H__ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "platform/CCFileUtils.h" diff --git a/native/cocos/platform/win32/CCPlatformDefine-win32.h b/native/cocos/platform/win32/CCPlatformDefine-win32.h index f4d4a35942..5099eecefb 100644 --- a/native/cocos/platform/win32/CCPlatformDefine-win32.h +++ b/native/cocos/platform/win32/CCPlatformDefine-win32.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS #ifdef __MINGW32__ diff --git a/native/cocos/platform/win32/compat/stdint.h b/native/cocos/platform/win32/compat/stdint.h index 80111b1868..adb4f3d75c 100644 --- a/native/cocos/platform/win32/compat/stdint.h +++ b/native/cocos/platform/win32/compat/stdint.h @@ -32,7 +32,7 @@ #ifndef _MSC_STDINT_H_ // [ #define _MSC_STDINT_H_ -#include "platform/CCPlatformConfig.h" + #if CC_PLATFORM == CC_PLATFORM_WINDOWS #ifndef _MSC_VER // [ diff --git a/native/cocos/scripting/js-bindings/docs/JSB2.0-learning-en.md b/native/cocos/scripting/js-bindings/docs/JSB2.0-learning-en.md index 543eb70296..426f0802a4 100644 --- a/native/cocos/scripting/js-bindings/docs/JSB2.0-learning-en.md +++ b/native/cocos/scripting/js-bindings/docs/JSB2.0-learning-en.md @@ -962,7 +962,8 @@ clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/sources # Configure building parameters for Cocos2D-X -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + # Configure extra building parameters extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s diff --git a/native/cocos/scripting/js-bindings/docs/JSB2.0-learning-zh.md b/native/cocos/scripting/js-bindings/docs/JSB2.0-learning-zh.md index 2e6e8fb522..1f6b88fadf 100644 --- a/native/cocos/scripting/js-bindings/docs/JSB2.0-learning-zh.md +++ b/native/cocos/scripting/js-bindings/docs/JSB2.0-learning-zh.md @@ -950,7 +950,8 @@ clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/sources # 配置引擎编译参数 -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + # 配置额外的编译参数 extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s diff --git a/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp b/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp index 566603e0d6..b42389d322 100644 --- a/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp +++ b/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "ScriptEngine.hpp" -#include "platform/CCPlatformConfig.h" + #if SCRIPT_ENGINE_TYPE == SCRIPT_ENGINE_V8 diff --git a/native/cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp b/native/cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp index 7b9060b539..f456bad3f5 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp @@ -3,7 +3,7 @@ #include "scripting/js-bindings/manual/jsb_global.h" #include "scripting/js-bindings/jswrapper/SeApi.h" #include "scripting/js-bindings/auto/jsb_gfx_auto.hpp" -#include "platform/CCPlatformConfig.h" + #if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_WINDOWS) #define USE_VULKAN diff --git a/native/external/config.json b/native/external/config.json index 97291eeebb..6e3a2dfbb2 100644 --- a/native/external/config.json +++ b/native/external/config.json @@ -1,9 +1,9 @@ { - "version": "v3d-gfx-15", + "version": "v3d-gfx-16", "from": { "type": "github", "owner": "cocos-creator", "name": "cocos2d-x-lite-external", - "checkout": "v3d-gfx-15" + "checkout": "v3d-gfx-16" } } diff --git a/native/templates/cocos2dx_files.json b/native/templates/cocos2dx_files.json index 11f8bb4162..d4a711b6be 100644 --- a/native/templates/cocos2dx_files.json +++ b/native/templates/cocos2dx_files.json @@ -197,7 +197,6 @@ "cocos/platform/CCFileUtils.h", "cocos/platform/CCImage.cpp", "cocos/platform/CCImage.h", - "cocos/platform/CCPlatformConfig.h", "cocos/platform/CCPlatformDefine.h", "cocos/platform/CCSAXParser.cpp", "cocos/platform/CCSAXParser.h", diff --git a/native/tools/tojs/anysdk-appstore.ini b/native/tools/tojs/anysdk-appstore.ini index 156bbef59f..a3d2825ab5 100644 --- a/native/tools/tojs/anysdk-appstore.ini +++ b/native/tools/tojs/anysdk-appstore.ini @@ -14,7 +14,8 @@ clang_headers = -I%(clangllvmdir)s/%(clang_include)s clang_flags = -nostdinc -x c++ -std=c++11 -U __SSE__ cocos_headers = -I%(anysdk_appstore_dir)s -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/anysdk-common.ini b/native/tools/tojs/anysdk-common.ini index dd0399f8d7..1ea2ab46b2 100644 --- a/native/tools/tojs/anysdk-common.ini +++ b/native/tools/tojs/anysdk-common.ini @@ -17,7 +17,8 @@ cocos_headers = -I%(anysdk_common_dir)s replace_headers = extensions/anysdk/js-bindings/jsb_anysdk_protocols_auto.hpp::jsb_anysdk_protocols_auto.hpp -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/cocos2dx.ini b/native/tools/tojs/cocos2dx.ini index 811418fdc6..1f65a380d1 100644 --- a/native/tools/tojs/cocos2dx.ini +++ b/native/tools/tojs/cocos2dx.ini @@ -15,7 +15,8 @@ clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/sources -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/cocos2dx_audioengine.ini b/native/tools/tojs/cocos2dx_audioengine.ini index 0635dda984..842e4ca2c2 100644 --- a/native/tools/tojs/cocos2dx_audioengine.ini +++ b/native/tools/tojs/cocos2dx_audioengine.ini @@ -17,7 +17,8 @@ clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/sources -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/cocos2dx_extension.ini b/native/tools/tojs/cocos2dx_extension.ini index 5676a05c0c..d6987b3424 100644 --- a/native/tools/tojs/cocos2dx_extension.ini +++ b/native/tools/tojs/cocos2dx_extension.ini @@ -15,7 +15,8 @@ clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/sources -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/cocos2dx_network.ini b/native/tools/tojs/cocos2dx_network.ini index 7ed9f8208f..40054d6c00 100644 --- a/native/tools/tojs/cocos2dx_network.ini +++ b/native/tools/tojs/cocos2dx_network.ini @@ -17,7 +17,8 @@ clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/sources -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/cocos2dx_video.ini b/native/tools/tojs/cocos2dx_video.ini index 0429656c83..a05daac0e8 100644 --- a/native/tools/tojs/cocos2dx_video.ini +++ b/native/tools/tojs/cocos2dx_video.ini @@ -18,7 +18,8 @@ clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/sources -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/gfx.ini b/native/tools/tojs/gfx.ini index 8f389189bd..394ccea03c 100644 --- a/native/tools/tojs/gfx.ini +++ b/native/tools/tojs/gfx.ini @@ -17,7 +17,8 @@ clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/renderer -I%(cocosdir)s/cocos/renderer/core-I%(cocosdir)s/cocos/math -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/source -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/gles2.ini b/native/tools/tojs/gles2.ini index f449afd5e3..21ee51480a 100644 --- a/native/tools/tojs/gles2.ini +++ b/native/tools/tojs/gles2.ini @@ -17,7 +17,8 @@ clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/renderer -I%(cocosdir)s/cocos/renderer/core -I%(cocosdir)s/cocos/renderer/gfx-gles2 -I%(cocosdir)s/cocos/math -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/source -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/gles3.ini b/native/tools/tojs/gles3.ini index 1df31cf31f..f55cf27193 100644 --- a/native/tools/tojs/gles3.ini +++ b/native/tools/tojs/gles3.ini @@ -17,7 +17,8 @@ clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/renderer -I%(cocosdir)s/cocos/renderer/core -I%(cocosdir)s/cocos/renderer/gfx-gles3 -I%(cocosdir)s/cocos/math -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/source -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/metal.ini b/native/tools/tojs/metal.ini index 7cdfb664b1..b3de5d1fba 100644 --- a/native/tools/tojs/metal.ini +++ b/native/tools/tojs/metal.ini @@ -17,7 +17,8 @@ clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/renderer -I%(cocosdir)s/cocos/renderer/core -I%(cocosdir)s/cocos/renderer/gfx-metal -I%(cocosdir)s/cocos/math -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/source -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers = diff --git a/native/tools/tojs/vulkan.ini b/native/tools/tojs/vulkan.ini index ad9c16b273..93333de3c3 100644 --- a/native/tools/tojs/vulkan.ini +++ b/native/tools/tojs/vulkan.ini @@ -17,7 +17,8 @@ clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/renderer -I%(cocosdir)s/cocos/renderer/core -I%(cocosdir)s/cocos/renderer/gfx-vulkan -I%(cocosdir)s/cocos/math -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/source -cocos_flags = -DANDROID +cocos_flags = -DANDROID -DCC_PLATFORM=3 -DCC_PLATFORM_MAC_IOS=1 -DCC_PLATFORM_MAC_OSX=4 -DCC_PLATFORM_WINDOWS=2 -DCC_PLATFORM_ANDROID=3 + cxxgenerator_headers =