Skip to content

Commit fbf754a

Browse files
authored
fix tinyxml wrong dependence (#332)
1 parent 222e67f commit fbf754a

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

tinyxml2/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,3 @@ set_target_properties(${target_name}
2121
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
2222
FOLDER "External"
2323
)
24-
25-
# TOCHECK, "tinyxml2.h" depend on cocos platform headers ""platform/CCPlatformMacros.h"", why?

tinyxml2/tinyxml2.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,21 @@ distribution.
2424
#ifndef TINYXML2_INCLUDED
2525
#define TINYXML2_INCLUDED
2626

27-
// #include "platform/CCPlatformConfig.h"
28-
// #include "platform/CCPlatformMacros.h"
29-
#define CC_DLL
27+
// external "tinyxml2.h" shouldn't depend on cocos internal headers "CCPlatformMacros.h"
28+
#if defined(_MSC_VER)
29+
# if defined(CC_STATIC)
30+
# define CC_DLL
31+
# else
32+
# if defined(_USRDLL)
33+
# define CC_DLL __declspec(dllexport)
34+
# else /* use a DLL library */
35+
# define CC_DLL __declspec(dllimport)
36+
# endif
37+
# endif
38+
#else
39+
# define CC_DLL
40+
#endif
41+
3042

3143
#if defined(ANDROID_NDK) || defined(__BORLANDC__) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY)
3244
# include <ctype.h>

0 commit comments

Comments
 (0)