Skip to content
Snippets Groups Projects
Commit aceb548c authored by Adrien Béraud's avatar Adrien Béraud
Browse files

cmake: make peer discovery build optional

parent afce4639
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ jobs: ...@@ -20,7 +20,7 @@ jobs:
run: | run: |
cd argon2 && make && sudo make install && cd .. cd argon2 && make && sudo make install && cd ..
- name: configure - name: configure
run: ./configure run: ./configure --enable-proxy-client --enable-proxy-server --enable-push-notifications
- name: make - name: make
run: make run: make
- name: make check - name: make check
......
...@@ -22,6 +22,7 @@ option (OPENDHT_PROXY_SERVER_IDENTITY "Allow clients to use the node identity" O ...@@ -22,6 +22,7 @@ option (OPENDHT_PROXY_SERVER_IDENTITY "Allow clients to use the node identity" O
option (OPENDHT_PROXY_CLIENT "Enable DHT proxy client, use Restinio and jsoncpp" OFF) option (OPENDHT_PROXY_CLIENT "Enable DHT proxy client, use Restinio and jsoncpp" OFF)
option (OPENDHT_PROXY_OPENSSL "Build DHT proxy with OpenSSL" ON) option (OPENDHT_PROXY_OPENSSL "Build DHT proxy with OpenSSL" ON)
option (OPENDHT_PROXY_HTTP_PARSER_FORK "Build DHT proxy with custom http_parser to support old API" OFF) option (OPENDHT_PROXY_HTTP_PARSER_FORK "Build DHT proxy with custom http_parser to support old API" OFF)
option (OPENDHT_PEER_DISCOVERY "Enable multicast peer discovery" ON)
option (OPENDHT_INDEX "Build DHT indexation feature" OFF) option (OPENDHT_INDEX "Build DHT indexation feature" OFF)
option (OPENDHT_TESTS "Add unit tests executable" OFF) option (OPENDHT_TESTS "Add unit tests executable" OFF)
option (OPENDHT_C "Build C bindings" OFF) option (OPENDHT_C "Build C bindings" OFF)
...@@ -177,7 +178,6 @@ list (APPEND opendht_SOURCES ...@@ -177,7 +178,6 @@ list (APPEND opendht_SOURCES
src/securedht.cpp src/securedht.cpp
src/dhtrunner.cpp src/dhtrunner.cpp
src/log.cpp src/log.cpp
src/peer_discovery.cpp
src/network_utils.cpp src/network_utils.cpp
src/thread_pool.cpp src/thread_pool.cpp
) )
...@@ -203,12 +203,17 @@ list (APPEND opendht_HEADERS ...@@ -203,12 +203,17 @@ list (APPEND opendht_HEADERS
include/opendht/securedht.h include/opendht/securedht.h
include/opendht/log.h include/opendht/log.h
include/opendht/log_enable.h include/opendht/log_enable.h
include/opendht/peer_discovery.h
include/opendht/thread_pool.h include/opendht/thread_pool.h
include/opendht/network_utils.h include/opendht/network_utils.h
include/opendht.h include/opendht.h
) )
if (OPENDHT_PEER_DISCOVERY)
list (APPEND opendht_SOURCES src/peer_discovery.cpp)
list (APPEND opendht_HEADERS include/opendht/peer_discovery.h)
add_definitions(-DOPENDHT_PEERDISCOVERY)
endif()
if (OPENDHT_PYTHON) if (OPENDHT_PYTHON)
message("Indexation enabled since it is required for Python support") message("Indexation enabled since it is required for Python support")
set(OPENDHT_INDEX ON) set(OPENDHT_INDEX ON)
...@@ -392,6 +397,12 @@ if (OPENDHT_TESTS) ...@@ -392,6 +397,12 @@ if (OPENDHT_TESTS)
tests/dhtproxytester.cpp tests/dhtproxytester.cpp
) )
endif() endif()
if (OPENDHT_PEER_DISCOVERY)
list (APPEND test_FILES
tests/peerdiscoverytester.h
tests/peerdiscoverytester.cpp
)
endif()
add_executable(opendht_unit_tests add_executable(opendht_unit_tests
tests/tests_runner.cpp tests/tests_runner.cpp
${test_FILES} ${test_FILES}
......
g++ -Wall -Wextra -Wfatal-errors -pedantic -g ../src/http.cpp tests_runner.cpp httptester.cpp -o run.out -lopendht -lpthread -lcppunit -ljsoncpp -DOPENDHT_JSONCPP -I../include/opendht -DASIO_STANDALONE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment