Skip to content

Commit

Permalink
cmake: fix using of external/xxhash for msvc generated project
Browse files Browse the repository at this point in the history
  • Loading branch information
vovkasm committed Jan 26, 2015
1 parent 7257447 commit 991ea45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ set(FLATBUFFERS_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/external)
message(STATUS "Flatbuffers include dirs: ${FLATBUFFERS_INCLUDE_DIRS}")


# build for 3rd party libraries
if(LINUX OR APPLE)
# build xxhash
add_subdirectory(external/xxhash)
endif()
set(XXHASH_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/external/xxhash)
set(XXHASH_LIBRARIES xxhash)

# libcocos2d.a
add_subdirectory(cocos)
Expand Down
8 changes: 3 additions & 5 deletions cocos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ set(COCOS_SRC cocos2d.cpp
)

#todo: provide prebuild versions of the xx libs for all platforms
include_directories(
../external/xxhash
../external/xxtea)
include_directories(../external/xxtea)


add_library(cocos2d ${COCOS_SRC})
Expand Down Expand Up @@ -127,11 +125,11 @@ else()
message( FATAL_ERROR "Unsupported platform, CMake will exit" )
endif()

foreach(pkg ZLIB MINIZIP JPEG PNG TIFF TinyXML2 FREETYPE WEBSOCKETS CURL FLATBUFFERS)
foreach(pkg ZLIB MINIZIP JPEG PNG TIFF TinyXML2 FREETYPE WEBSOCKETS CURL FLATBUFFERS XXHASH)
cocos_use_pkg(cocos2d ${pkg})
endforeach()

target_link_libraries(cocos2d xxhash ${PLATFORM_SPECIFIC_LIBS})
target_link_libraries(cocos2d ${PLATFORM_SPECIFIC_LIBS})

if(USE_WEBP)
add_definitions(-DCC_USE_WEBP=1)
Expand Down

0 comments on commit 991ea45

Please sign in to comment.