Merge pull request #31 from nurupo/master

Fixed cmake and Travis
This commit is contained in:
irungentoo 2013-07-12 18:10:43 -07:00
commit 4899be84d1
2 changed files with 22 additions and 20 deletions

View File

@ -5,14 +5,16 @@ compiler:
before_script:
- git clone git://github.com/jedisct1/libsodium.git
- cd libsodium
- git checkout tags/0.4.2
- ./autogen.sh
- ./configure && make -j3 check
- sudo make install
- sudo ldconfig
- cd ..
script:
#- cmake CMakeLists.txt
#- make -j3
- gcc -o test -Wall -Werror -Ilibsodium/src/libsodium/include/ core/*.c libsodium/src/libsodium/.libs/libsodium.a testing/Messenger_test.c
- cmake CMakeLists.txt
- make -j3
notifications:
email: false
@ -22,4 +24,3 @@ notifications:
- "chat.freenode.net#InsertProjectNameHere"
on_success: always
on_failure: always

View File

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 2.6.0)
project(TOX C)
set(exe_name toxMessengerTest)
set(core_sources
core/DHT.c
core/network.c
@ -11,20 +13,19 @@ set(core_sources
set(test_sources
testing/Messenger_test.c)
set(exe_name TOX-app)
add_executable(${exe_name}
${core_sources}
${test_sources})
if(WIN32)
target_link_libraries(${exe_name} ws2_32 libsodium)
else(WIN32)
target_link_libraries(libsodium)
endif(WIN32)
include_directories(${TOX_SOURCE_DIR}/sodium/include/)
target_link_libraries(${exe_name} ws2_32
${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a)
else()
target_link_libraries(${exe_name} sodium)
endif()
if(CMAKE_COMPILER_IS_GNUCC)
message(STATUS "==== GCC detected - Adding compiler flags")
message(STATUS "==== GCC detected - Adding compiler flags ====")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
endif()