mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Made a cmake project for Core
This commit is contained in:
parent
d35ddc1618
commit
533f136d0e
|
@ -1,5 +1,6 @@
|
|||
cmake_minimum_required(VERSION 2.6.0)
|
||||
|
||||
#MinGW prints more warnings for -Wall than gcc does, thus causing build to fail
|
||||
if(NOT WIN32)
|
||||
if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang"))
|
||||
message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====")
|
||||
|
@ -7,21 +8,10 @@ if(NOT WIN32)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/)
|
||||
endif()
|
||||
|
||||
set(core_sources
|
||||
core/DHT.c
|
||||
core/network.c
|
||||
core/Lossless_UDP.c
|
||||
core/net_crypto.c
|
||||
core/Messenger.c)
|
||||
|
||||
add_library(core ${core_sources})
|
||||
|
||||
macro(linkCoreLibraries exe_name)
|
||||
add_dependencies(${exe_name} core)
|
||||
if(WIN32)
|
||||
include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/)
|
||||
target_link_libraries(${exe_name} core
|
||||
${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a
|
||||
ws2_32)
|
||||
|
@ -33,5 +23,6 @@ endmacro()
|
|||
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
|
||||
ADD_SUBDIRECTORY(testing)
|
||||
ADD_SUBDIRECTORY(other)
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(testing)
|
||||
add_subdirectory(other)
|
15
core/CMakeLists.txt
Normal file
15
core/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
cmake_minimum_required(VERSION 2.6.0)
|
||||
project(core C)
|
||||
|
||||
if(WIN32)
|
||||
include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/)
|
||||
endif()
|
||||
|
||||
set(core_sources
|
||||
DHT.c
|
||||
network.c
|
||||
Lossless_UDP.c
|
||||
net_crypto.c
|
||||
Messenger.c)
|
||||
|
||||
add_library(core ${core_sources})
|
Loading…
Reference in New Issue
Block a user