Add document build

This commit is contained in:
wener
2017-03-26 21:20:33 +08:00
committed by Max Lv
parent 233cf15834
commit 88ef344262
3 changed files with 115 additions and 5 deletions
+29 -5
View File
@@ -97,13 +97,33 @@ find_library(LIBEV_SHARED ev)
find_library(LIBUDNS_SHARED udns)
find_library(LIBPCRE_SHARED pcre)
list(APPEND DEPS bloom m ${LIBEV} ${LIBUDNS} ${LIBPCRE} ${LIBSODIUM} ${LIBMBEDTLS} ${LIBMBEDCRYPTO})
list(APPEND DEPS_SHARED bloom-shared m ${LIBEV_SHARED} ${LIBUDNS_SHARED} ${LIBPCRE_SHARED} ${LIBSODIUM_SHARED}
${LIBMBEDTLS_SHARED} ${LIBMBEDCRYPTO_SHARED})
# Dependencies we need for static and shared
list(APPEND DEPS
m
bloom
${LIBEV}
${LIBUDNS}
${LIBPCRE}
${LIBSODIUM}
${LIBMBEDTLS}
${LIBMBEDCRYPTO}
)
list(APPEND DEPS_SHARED
m
bloom-shared
${LIBEV_SHARED}
${LIBUDNS_SHARED}
${LIBPCRE_SHARED}
${LIBSODIUM_SHARED}
${LIBMBEDTLS_SHARED}
${LIBMBEDCRYPTO_SHARED}
)
find_package (Threads)
# Add our targets
# ------------------------------------------------------------------
# Static
# By default we use normal name for static, all shared targets will add a `-shared' suffix
add_executable(ss-server ${SS_SERVER_SOURCE})
add_executable(ss-tunnel ${SS_TUNNEL_SOURCE})
add_executable(ss-manager ${SS_MANAGER_SOURCE})
@@ -132,6 +152,9 @@ target_link_libraries(shadowsocks-libev cork ipset ${DEPS})
# ------------------------------------------------------------------
# Shared
# Shared target will have a `-shared' suffix
# All shared dependency also have `-shared' suffix
# For shared binary, we still use the same name as static, without `-shared', but will output to shared directory
add_executable(ss-server-shared ${SS_SERVER_SOURCE})
add_executable(ss-tunnel-shared ${SS_TUNNEL_SOURCE})
add_executable(ss-manager-shared ${SS_MANAGER_SOURCE})
@@ -172,7 +195,8 @@ set_target_properties(shadowsocks-libev-shared PROPERTIES OUTPUT_NAME shadowsock
target_compile_definitions(shadowsocks-libev-shared PUBLIC -DMODULE_LOCAL)
target_link_libraries(shadowsocks-libev-shared cork-shared ipset-shared ${DEPS_SHARED})
# ------------------------------------------------------------------
# Misc
install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
DESTINATION bin
FILES_MATCHING PATTERN "ss-*")