commit | 9d3f5c8f1d62de43da85a63b07ba3b268648bc93 | [log] [tgz] |
---|---|---|
author | Ben Clayton <bclayton@google.com> | Wed Jun 10 12:31:43 2020 +0100 |
committer | Ben Clayton <bclayton@google.com> | Wed Jun 10 15:10:57 2020 +0100 |
tree | 17a84b37b396b2335ef430065fa36b8d52ab4fdb | |
parent | bb3dbcd2c37ccf0f8d6a88672edf2e1f9971447c [diff] |
clang: Enable -Weverything, fix all warnings This change fixes the following warnings: ``` -Wc++98-compat-extra-semi -Wc++98-compat-local-type-template-args -Wc++98-compat-pedantic -Wc++98-compat -Wcomma -Wdeprecated-copy-dtor -Wexit-time-destructors -Wextra-semi-stmt -Wextra-semi -Wfloat-conversion -Wfloat-equal -Wformat-nonliteral -Wglobal-constructors -Winconsistent-missing-destructor-override -Wnon-virtual-dtor -Wold-style-cast -Wpadded -Wreturn-std-move-in-c++11 -Wshadow-field-in-constructor -Wshadow-uncaptured-local -Wshift-sign-overflow -Wsign-conversion -Wundef -Wunreachable-code-return -Wused-but-marked-unused -Wweak-vtables -Wzero-as-null-pointer-constant ```
cppdap
is a C++11 library (“SDK”) implementation of the Debug Adapter Protocol, providing an API for implementing a DAP client or server.
cppdap
provides C++ type-safe structures for the full DAP specification, and provides a simple way to add custom protocol messages.
cppdap
provides CMake build files to build the library, unit tests and examples.
cppdap
depends on the nlohmann/json
library, and the unit tests depend on the googletest
library. Both are referenced as a git submodules.
Before building, fetch the git submodules with:
cd <path-to-cppdap> git submodule update --init
Next, generate the build files:
cd <path-to-cppdap> mkdir build cd build cmake ..
You may wish to suffix the cmake ..
line with any of the following flags:
-DCPPDAP_BUILD_TESTS=1
- Builds the cppdap
unit tests-DCPPDAP_BUILD_EXAMPLES=1
- Builds the cppdap
examples-DCPPDAP_INSTALL_VSCODE_EXAMPLES=1
- Installs the cppdap
examples as Visual Studio Code extensions-DCPPDAP_WARNINGS_AS_ERRORS=1
- Treats all compiler warnings as errors.Finally, build the project:
make
cppdap
can be built using Visual Studio 2019's CMake integration.
cppdap
in your CMake projectYou can build and link cppdap
using add_subdirectory()
in your project's CMakeLists.txt
file:
set(CPPDAP_DIR <path-to-cppdap>) # example <path-to-cppdap>: "${CMAKE_CURRENT_SOURCE_DIR}/third_party/cppdap" add_subdirectory(${CPPDAP_DIR})
This will define the cppdap
library target, which you can pass to target_link_libraries()
:
target_link_libraries(<target> cppdap) # replace <target> with the name of your project's target
You may also wish to specify your own paths to the third party libraries used by cppdap
. You can do this by setting any of the following variables before the call to add_subdirectory()
:
set(CPPDAP_THIRD_PARTY_DIR <third-party-root-directory>) # defaults to ${CPPDAP_DIR}/third_party set(CPPDAP_JSON_DIR <path-to-nlohmann-json>) # defaults to ${CPPDAP_THIRD_PARTY_DIR}/json set(CPPDAP_GOOGLETEST_DIR <path-to-googletest>) # defaults to ${CPPDAP_THIRD_PARTY_DIR}/googletest add_subdirectory(${CPPDAP_DIR})
Note: This is not an officially supported Google product