File tree Expand file tree Collapse file tree 14 files changed +16
-27
lines changed
Expand file tree Collapse file tree 14 files changed +16
-27
lines changed Original file line number Diff line number Diff line change 1- /boosty /boost_1_80_0 /
2- /boosty /cmake-bcp /
3- /boosty /boost_1_80_0.tar.gz
4- /boosty /example /main
5- /boosty /extracted /doc /
6- /boosty /extracted /libs /
7- /boosty /extracted /boost.png
8-
9- /example /example
10- /example /hasher
11- /example /scratch
12-
131/bazel- *
142/.build /
153/.coverage /
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.24)
55project (dd-trace-cpp)
66
77option (BUILD_COVERAGE "Build code with code coverage profiling instrumentation" OFF )
8- option (BUILD_EXAMPLE "Build the example program (example/) " OFF )
8+ option (BUILD_HASHER_EXAMPLE "Build the example program examples/hasher " OFF )
99option (BUILD_TESTING "Build the unit tests (test/)" OFF )
1010option (SANITIZE "Build with address sanitizer and undefined behavior sanitizer" OFF )
1111option (FUZZ_W3C_PROPAGATION "Build a fuzzer for W3C propagation" OFF )
@@ -226,6 +226,5 @@ if(BUILD_TESTING)
226226 add_subdirectory (test )
227227endif ()
228228
229- if (BUILD_EXAMPLE)
230- add_subdirectory (example)
231- endif ()
229+ # Each example has its own build flag.
230+ add_subdirectory (examples)
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- find src/ example / test/ -type f \( -name ' *.h' -o -name ' *.cpp' \) -print0 | \
3+ find src/ examples / test/ -type f \( -name ' *.h' -o -name ' *.cpp' \) -print0 | \
44 xargs -0 clang-format-14 --style=file --dry-run -Werror
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ formatter=clang-format-$version
1414formatter_options=" --style=file -i"
1515
1616find_sources () {
17- find src/ example / test/ fuzz/ -type f \( -name ' *.h' -o -name ' *.cpp' \) " $@ "
17+ find src/ examples / test/ fuzz/ -type f \( -name ' *.h' -o -name ' *.cpp' \) " $@ "
1818}
1919
2020# If the correct version of clang-format is installed, then use it and quit.
Original file line number Diff line number Diff line change @@ -19,23 +19,22 @@ cd "$(dirname "$0")"/..
1919
2020mkdir -p .build
2121cd .build
22- cmake .. -DBUILD_EXAMPLE =1
22+ cmake .. -DBUILD_HASHER_EXAMPLE =1
2323# shellcheck disable=SC2086
2424make -j " $( nproc) " $verbosity_flags
25+ cd ../
2526
2627if [ " $build_only " -eq 1 ]; then
2728 exit
2829fi
2930
30- trap ' docker compose --project-directory ../example down' INT
31+ trap ' docker compose --project-directory examples/hasher down' INT
3132
32- echo ' Running example...'
33+ echo ' Running hasher example...'
3334if [ " $DD_API_KEY " = ' ' ]; then
3435 >&2 echo " The DD_API_KEY environment variable must be set to a Datadog API key."
3536 exit 1
3637fi
37- docker compose --project-directory ../example up --detach --remove-orphans
38- # docker compose --project-directory ../example logs --follow &
39- ./example/example " $@ "
40- docker compose --project-directory ../example down
41- # wait
38+ docker compose --project-directory examples/hasher up --detach --remove-orphans
39+ .build/examples/hasher/example " $@ "
40+ docker compose --project-directory examples/hasher down
Original file line number Diff line number Diff line change 1+ if (BUILD_HASHER_EXAMPLE)
2+ add_subdirectory (hasher)
3+ endif ()
File renamed without changes.
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ file or directory encountered.
1010The program produces a trace of this calculation, where each file encountered
1111is a span whose duration is the time it took to hash the file.
1212
13- [ ../bin/example] ( ../bin/example ) builds and runs the example.
13+ [ ../bin/hasher- example] ( ../bin/hasher- example ) builds and runs this example.
1414
1515![ example console usage] ( console.png )
1616
You can’t perform that action at this time.
0 commit comments