Update CMakeLists.txt

Add WIN32 property to add_executable function to prevent the following error on Windows
`MSVCRTD.lib(crtexe.obj)👎 error: LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup`
This commit is contained in:
Furkan Üzümcü 2015-06-07 20:44:39 +03:00
parent 3269df546c
commit 6433a69ed1
1 changed files with 10 additions and 2 deletions

View File

@ -135,9 +135,17 @@ set(GAME_HEADERS
)
if(GAME_HEADERS)
add_executable(${APP_NAME} ${GAME_SRC} ${GAME_HEADERS})
if ( WIN32 )
add_executable(${APP_NAME} WIN32 ${GAME_SRC} ${GAME_HEADERS})
else()
add_executable(${APP_NAME} ${GAME_SRC} ${GAME_HEADERS})
endif ( WIN32 )
else()
add_executable(${APP_NAME} ${GAME_SRC})
if ( WIN32 )
add_executable(${APP_NAME} WIN32 ${GAME_SRC})
else()
add_executable(${APP_NAME} ${GAME_SRC})
endif ( WIN32 )
endif()
target_link_libraries(${APP_NAME} cocos2d)