From 991854be0c83045974477d554394080f6da906cb Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Sun, 13 May 2018 16:50:47 +0200 Subject: [PATCH 1/5] libndt.cpp: fix building with cURL disabled --- libndt.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libndt.cpp b/libndt.cpp index eef0930..70b0935 100644 --- a/libndt.cpp +++ b/libndt.cpp @@ -1042,6 +1042,7 @@ bool Client::query_mlabns_curl(const std::string &url, long timeout, } return true; #else + (void)url, (void)timeout, (void)body; EMIT_WARNING("cURL not compiled in; don't know how to get server"); return false; #endif From 1a9e01de3288c80326fbbb63fb6fabf8c8f21f71 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Sun, 13 May 2018 16:51:08 +0200 Subject: [PATCH 2/5] CMakeLists.txt: simplify integration with MK --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a22ae25..f9857a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,8 +101,8 @@ endif() # Library add_library( - ndt - STATIC + ndt_objects + OBJECT curlx.cpp curlx.hpp libndt.cpp @@ -111,9 +111,11 @@ add_library( strtonum.h ) target_include_directories( - ndt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} + ndt_objects PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CURL_INCLUDE_DIRS} ) + +add_library(ndt $) target_link_libraries(ndt ${CURL_LIBRARIES}) install( FILES From ce5c08fb911cc37cce0459c46793c28cb2d9774f Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Sun, 13 May 2018 16:51:39 +0200 Subject: [PATCH 3/5] Bump API version --- libndt.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libndt.hpp b/libndt.hpp index abae3fb..6c29a84 100644 --- a/libndt.hpp +++ b/libndt.hpp @@ -27,7 +27,7 @@ namespace libndt { constexpr uint64_t api_major = 0; constexpr uint64_t api_minor = 20; -constexpr uint64_t api_patch = 1; +constexpr uint64_t api_patch = 2; constexpr uint8_t nettest_middlebox = 1 << 0; constexpr uint8_t nettest_upload = 1 << 1; From 12ce4e51a9fe11202351198b511ced7b66eec5bf Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Sun, 13 May 2018 17:10:17 +0200 Subject: [PATCH 4/5] CMakeLists.txt: propagate ndt_objects includes It seems that not doing that prevents AppVeyor from building. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9857a2..2ef4f96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,6 +116,11 @@ target_include_directories( ) add_library(ndt $) +target_include_directories( + # Duplicate includes of `ndt_objects` because when building binaries we do + # not use `ndt_objects`, so includes are not transitively picked up. + ndt PUBLIC $ +) target_link_libraries(ndt ${CURL_LIBRARIES}) install( FILES From e3f934a6137294cc31bce57435894ab426f21d95 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Sun, 13 May 2018 17:20:13 +0200 Subject: [PATCH 5/5] CMakeLists.txt: simpler fix for propagating includes --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ef4f96..b1f9b21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,7 +119,10 @@ add_library(ndt $) target_include_directories( # Duplicate includes of `ndt_objects` because when building binaries we do # not use `ndt_objects`, so includes are not transitively picked up. - ndt PUBLIC $ + # TODO(bassosimone): we can perhaps do this using a generator expression + # but so far I have failed to do this properly. + ndt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} + ${CURL_INCLUDE_DIRS} ) target_link_libraries(ndt ${CURL_LIBRARIES}) install(