2020-04-20 03:46:05 +02:00
|
|
|
# Create library
|
|
|
|
add_library(SimpleSocket STATIC
|
2020-04-27 09:59:05 +02:00
|
|
|
include/HostConf.h
|
2020-04-20 03:46:05 +02:00
|
|
|
include/StatTimer.h
|
|
|
|
include/ActiveSocket.h ActiveSocket.cpp
|
|
|
|
include/PassiveSocket.h PassiveSocket.cpp
|
|
|
|
include/SimpleSocket.h SimpleSocket.cpp
|
|
|
|
)
|
|
|
|
# Configure include folders
|
|
|
|
target_include_directories(SimpleSocket PRIVATE ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
target_include_directories(SimpleSocket PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
|
|
|
|
# Configure macro options
|
|
|
|
target_compile_definitions(SimpleSocket PRIVATE _WIN32_WINNT=0x0601)
|
2020-08-19 15:49:45 +02:00
|
|
|
# Enable LTO
|
|
|
|
if (LTO_ENABLED)
|
|
|
|
target_link_libraries(SimpleSocket PRIVATE -flto)
|
|
|
|
endif()
|
|
|
|
# OS and compiler checks.
|
2020-04-27 09:37:39 +02:00
|
|
|
if(WIN32)
|
2020-04-20 03:46:05 +02:00
|
|
|
target_link_libraries(SimpleSocket PUBLIC Ws2_32)
|
|
|
|
endif()
|