This repository has been archived on 2020-05-25. You can view files and clone it, but cannot push or open issues or pull requests.
tdlib-fork/tdactor/CMakeLists.txt
levlam fe6a635ebf Do not tdactor example executable when cross-compiling.
GitOrigin-RevId: a3bc7956826bb51ac114712ad0874cbc2b2a5cf2
2019-11-18 00:03:03 +03:00

59 lines
1.5 KiB
CMake

cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
#SOURCE SETS
set(TDACTOR_SOURCE
td/actor/impl/ConcurrentScheduler.cpp
td/actor/impl/Scheduler.cpp
td/actor/MultiPromise.cpp
td/actor/Timeout.cpp
td/actor/impl/Actor-decl.h
td/actor/impl/Actor.h
td/actor/impl/ActorId-decl.h
td/actor/impl/ActorId.h
td/actor/impl/ActorInfo-decl.h
td/actor/impl/ActorInfo.h
td/actor/impl/EventFull-decl.h
td/actor/impl/EventFull.h
td/actor/impl/ConcurrentScheduler.h
td/actor/impl/Event.h
td/actor/impl/Scheduler-decl.h
td/actor/impl/Scheduler.h
td/actor/Condition.h
td/actor/MultiPromise.h
td/actor/PromiseFuture.h
td/actor/SchedulerLocalStorage.h
td/actor/SignalSlot.h
td/actor/SleepActor.h
td/actor/Timeout.h
td/actor/actor.h
)
set(TDACTOR_TEST_SOURCE
${CMAKE_CURRENT_SOURCE_DIR}/test/actors_main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test/actors_simple.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test/actors_workers.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test/actors_bugs.cpp
PARENT_SCOPE
)
#RULES
#LIBRARIES
add_library(tdactor STATIC ${TDACTOR_SOURCE})
target_include_directories(tdactor PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(tdactor PUBLIC tdutils)
if (NOT CMAKE_CROSSCOMPILING)
add_executable(example example/example.cpp)
target_link_libraries(example PRIVATE tdactor)
endif()
install(TARGETS tdactor EXPORT TdTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)