yedf2 / handy

🔥简洁易用的C++11网络库 / 支持单机千万并发连接 / a simple C++11 network server framework
BSD 2-Clause "Simplified" License
4.56k stars 1.33k forks source link

Minor CMake Cleanups #62

Closed saidinesh5 closed 5 years ago

saidinesh5 commented 5 years ago

Build both handy as both shared and static library. Build the shared library and examples only optionally.

This way integration becomes easier with downstream projects:

add handy as a git submodule to say a folder called vendor in your CMakeLists.txt

add_subdirectory("vendor/handy" EXCLUDE_FROM_ALL)

target_include_directories(${PROJECT_NAME} PUBLIC
    "vendor/handy"
)

target_link_libraries(${PROJECT_NAME} PUBLIC
    handy_s
)
saidinesh5 commented 5 years ago

Hi,

I have updated the README english with the details on how to:

The shared library and examples are disabled by default because they bloat up compile times when including handy in their own cmake projects. Once we provide proper versioning info along with something like a pkgconfig file, we can also enable building the shared library by default maybe.

Could you update the chinese readme too, once this is merged?

Thanks for the nice library.

D