peerplays_migrated/libraries/net/CMakeLists.txt
Nathan Hourt 082df7ab4a Allow build of dynamic libraries
In order to support dynamically linked nodes based on Graphene, add
support for building dynamic libraries for the core Graphene
modules: chain, db, protocol, net, and utilities.
2021-11-11 14:20:40 -05:00

41 lines
1.1 KiB
CMake

file(GLOB HEADERS "include/graphene/net/*.hpp")
set(SOURCES node.cpp
stcp_socket.cpp
core_messages.cpp
exceptions.cpp
peer_database.cpp
peer_connection.cpp
message.cpp
message_oriented_connection.cpp)
if (NOT ${GRAPHENE_BUILD_DYNAMIC_LIBRARIES})
add_library( graphene_net ${SOURCES} ${HEADERS} )
else()
add_library( graphene_net SHARED ${SOURCES} ${HEADERS} )
endif()
target_link_libraries( graphene_net
PUBLIC fc graphene_db graphene_protocol )
target_include_directories( graphene_net
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include"
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../chain/include" "${CMAKE_CURRENT_BINARY_DIR}/../chain/include"
)
if(MSVC)
set_source_files_properties( node.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
endif(MSVC)
if (USE_PCH)
set_target_properties(graphene_net PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(graphene_net)
endif(USE_PCH)
install( TARGETS
graphene_net
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install( FILES ${HEADERS} DESTINATION "include/graphene/net" )