2019-10-07 10:08:47 +00:00
|
|
|
|
2019-10-05 15:03:25 +00:00
|
|
|
if(SHADOW)
|
2020-05-17 19:41:48 +00:00
|
|
|
add_shadow_plugin(shadow-plugin main.cpp ${TRACY_ROOT}/TracyClient.cpp)
|
|
|
|
target_link_libraries(shadow-plugin liblokinet)
|
|
|
|
enable_lto(shadow-plugin)
|
2019-10-05 15:03:25 +00:00
|
|
|
else()
|
2020-05-17 19:41:48 +00:00
|
|
|
add_executable(lokinet main.cpp)
|
|
|
|
add_executable(lokinetctl lokinetctl.cpp)
|
|
|
|
enable_lto(lokinet lokinetctl)
|
2019-10-05 15:03:25 +00:00
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
if(TRACY_ROOT)
|
|
|
|
target_sources(lokinet PRIVATE ${TRACY_ROOT}/TracyClient.cpp)
|
|
|
|
endif()
|
2019-10-05 15:03:25 +00:00
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
foreach(exe lokinet lokinetctl)
|
|
|
|
if(WIN32 AND NOT MSVC_VERSION)
|
|
|
|
target_sources(${exe} PRIVATE ../llarp/win32/version.rc)
|
|
|
|
target_link_libraries(${exe} PRIVATE ws2_32 iphlpapi)
|
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
|
|
|
target_link_directories(${exe} PRIVATE /usr/local/lib)
|
|
|
|
endif()
|
|
|
|
target_link_libraries(${exe} PRIVATE liblokinet)
|
|
|
|
target_compile_definitions(${exe} PRIVATE -DVERSIONTAG=${GIT_VERSION_REAL})
|
|
|
|
add_log_tag(${exe})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
install(TARGETS lokinet RUNTIME DESTINATION bin COMPONENT lokinet)
|
2019-10-05 15:03:25 +00:00
|
|
|
if(WIN32)
|
2020-04-03 14:14:19 +00:00
|
|
|
install(PROGRAMS ${CMAKE_SOURCE_DIR}/lokinet-bootstrap.ps1 DESTINATION bin COMPONENT lokinet)
|
2019-10-05 15:03:25 +00:00
|
|
|
else()
|
2020-04-03 14:14:19 +00:00
|
|
|
install(PROGRAMS ${CMAKE_SOURCE_DIR}/lokinet-bootstrap DESTINATION bin COMPONENT lokinet)
|
2019-10-05 15:03:25 +00:00
|
|
|
endif()
|
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
2019-10-05 15:03:25 +00:00
|
|
|
install(CODE "execute_process(COMMAND setcap cap_net_admin,cap_net_bind_service=+eip ${CMAKE_INSTALL_PREFIX}/bin/lokinet)")
|
|
|
|
endif()
|
2019-10-05 16:48:05 +00:00
|
|
|
|
|
|
|
if(CURL_FOUND)
|
2020-05-17 19:41:48 +00:00
|
|
|
target_include_directories(lokinetctl PRIVATE ${CURL_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(lokinetctl PRIVATE ${CURL_LIBRARIES})
|
2019-10-05 16:48:05 +00:00
|
|
|
endif(CURL_FOUND)
|
|
|
|
|
2020-05-17 19:41:48 +00:00
|
|
|
endif()
|