Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 1cf4902

Browse files
committed
Simplify libndt installation
- no subdirs for header and library, just use the libndt name - for consistency with above, remove `measurement_kit` namespace
1 parent ca06ec3 commit 1cf4902

File tree

9 files changed

+6
-34
lines changed

9 files changed

+6
-34
lines changed

CMakeLists.txt

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ endif()
105105
# Library
106106

107107
add_library(
108-
ndt_objects
109-
OBJECT
108+
ndt
110109
curlx.cpp
111110
curlx.hpp
112111
libndt.cpp
@@ -115,16 +114,6 @@ add_library(
115114
strtonum.h
116115
)
117116
target_include_directories(
118-
ndt_objects PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
119-
${CURL_INCLUDE_DIRS}
120-
)
121-
122-
add_library(ndt $<TARGET_OBJECTS:ndt_objects>)
123-
target_include_directories(
124-
# Duplicate includes of `ndt_objects` because when building binaries we do
125-
# not use `ndt_objects`, so includes are not transitively picked up.
126-
# TODO(bassosimone): we can perhaps do this using a generator expression
127-
# but so far I have failed to do this properly.
128117
ndt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
129118
${CURL_INCLUDE_DIRS}
130119
)
@@ -135,13 +124,13 @@ install(
135124
FILES
136125
libndt.hpp
137126
DESTINATION
138-
include/measurement_kit/libndt
127+
include
139128
)
140129
install(
141130
TARGETS
142131
ndt
143132
DESTINATION
144-
lib/measurement_kit/
133+
lib
145134
)
146135
install(
147136
TARGETS

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
# Measurement Kit NDT engine
1+
# NDT Client Engine
22

33
[![GitHub license](https://img.shields.io/github/license/measurement-kit/libndt.svg)](https://raw.githubusercontent.com/measurement-kit/libndt/master/LICENSE) [![Github Releases](https://img.shields.io/github/release/measurement-kit/libndt.svg)](https://github.com/measurement-kit/libndt/releases) [![Build Status](https://img.shields.io/travis/measurement-kit/libndt/master.svg)](https://travis-ci.org/measurement-kit/libndt) [![Coverage Status](https://img.shields.io/coveralls/measurement-kit/libndt/master.svg)](https://coveralls.io/github/measurement-kit/libndt?branch=master) [![Build status](https://img.shields.io/appveyor/ci/bassosimone/libndt/master.svg)](https://ci.appveyor.com/project/bassosimone/libndt/branch/master) [![Documentation](https://codedocs.xyz/measurement-kit/libndt.svg)](https://codedocs.xyz/measurement-kit/libndt/)
44

5-
This repository compiles a NDT engine that is meant to be integrated into
6-
the build of Measurement Kit.
5+
`libndt` is a Network-Diagnostic-Tool (NDT) C++11 client engine.
76

87
## Synopsis
98

109
This example runs a NDT download-only nettest with a nearby server:
1110

1211
```C++
13-
#include <measurement_kit/libndt/libndt.hpp>
12+
#include <libndt.hpp>
1413

1514
int main() {
16-
using namespace measurement_kit;
1715
libndt::Client client;
1816
client.run();
1917
}

curlx.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ static size_t curl_callback(char *ptr, size_t size, size_t nmemb,
3131

3232
} // extern "C"
3333

34-
namespace measurement_kit {
3534
namespace libndt {
3635

3736
#define EMIT_WARNING(client, statements) \
@@ -175,5 +174,4 @@ Curl::~Curl() noexcept {}
175174
CURL *Curl::easy_init() noexcept { return ::curl_easy_init(); }
176175

177176
} // namespace libndt
178-
} // namespace measurement_kit
179177
#endif // HAVE_CURL

curlx.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#include "libndt.hpp"
1616

17-
namespace measurement_kit {
1817
namespace libndt {
1918

2019
class CurlDeleter {
@@ -64,6 +63,5 @@ class Curl {
6463
};
6564

6665
} // namespace libndt
67-
} // namespace measurement_kit
6866
#endif // HAVE_CURL
6967
#endif // MEASUREMENT_KIT_LIBNDT_CURLX_HPP

curlx_test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
#include "catch.hpp"
99

10-
using namespace measurement_kit;
11-
1210
// Curl::method_get_maybe_socks5() tests
1311
// -------------------------------------
1412

libndt-client.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ static void usage() {
3030
}
3131

3232
int main(int, char **argv) {
33-
using namespace measurement_kit;
3433
libndt::Settings settings;
3534
settings.verbosity = libndt::verbosity_quiet;
3635
settings.nettest_flags = 0; // you need to enable tests explicitly

libndt.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "json.hpp"
3737
#include "strtonum.h"
3838

39-
namespace measurement_kit {
4039
namespace libndt {
4140

4241
// Private constants
@@ -1654,4 +1653,3 @@ int Client::getsockopt(int socket, int level, int name, void *value,
16541653
}
16551654

16561655
} // namespace libndt
1657-
} // namespace measurement_kit

libndt.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@
4343
#include <string>
4444
#include <vector>
4545

46-
/// Contains measurement-kit code.
47-
namespace measurement_kit {
48-
4946
/// Contains measurement-kit/libndt code.
5047
namespace libndt {
5148

@@ -406,5 +403,4 @@ enum class Err {
406403
};
407404

408405
} // namespace libndt
409-
} // namespace measurement_kit
410406
#endif

libndt_test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
// Speaking of coverage, if specific code is already tested by running the
3939
// example client, we don't need to write also a test for it here.
4040

41-
using namespace measurement_kit;
42-
4341
// Client::run() tests
4442
// -------------------
4543

0 commit comments

Comments
 (0)