Merge pull request #6945 from John-He-928/mingw-build

Fix MinGW build
This commit is contained in:
minggo 2014-06-19 22:08:28 +08:00
commit 9f0a566b8a
4 changed files with 11 additions and 17 deletions

View File

@ -100,6 +100,8 @@ endif()
if(MINGW)
add_definitions(-DGLEW_STATIC)
add_definitions(-D__SSIZE_T)
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lws2_32")
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lws2_32")
endif()

View File

@ -24,14 +24,14 @@ set(COCOS_NETWORK_SRC
${PLATFORM_SRC}
)
IF ( WIN32 )
set(COCOS_NETWORK_LINK
libcurl_imp
${PLATFORM_LINK}
)
IF (WIN32 AND NOT MINGW)
set(COCOS_NETWORK_LINK
libcurl_imp
${PLATFORM_LINK}
)
ELSE()
set(COCOS_NETWORK_LINK
curl
${PLATFORM_LINK}
)
set(COCOS_NETWORK_LINK
curl
${PLATFORM_LINK}
)
ENDIF()

View File

@ -73,7 +73,3 @@ else()
endif()
target_link_libraries(${APP_NAME} audio cocos2d)
# MinGW builds need to link libws2_32 and libglew32 manually
if (MINGW)
target_link_libraries(${APP_NAME} glew32 ws2_32)
endif()

View File

@ -203,10 +203,6 @@ target_link_libraries(${APP_NAME}
cocos2d
box2d
)
# MinGW builds need to link libws2_32 manually
if (MINGW)
target_link_libraries(${APP_NAME} ws2_32)
endif()
set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}")