diff options
author | Brad King <brad.king@kitware.com> | 2023-05-19 14:33:13 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-26 13:36:14 (GMT) |
commit | 5ec69eb58c4d863e9f8f278b7c78d08f8cedd3f4 (patch) | |
tree | 204366b19fba81e4374cd44cb5816e325bfb258f /Utilities | |
parent | 3381e6bd5cbfa1694f07c97a19747adda10b06f2 (diff) | |
download | CMake-5ec69eb58c4d863e9f8f278b7c78d08f8cedd3f4.zip CMake-5ec69eb58c4d863e9f8f278b7c78d08f8cedd3f4.tar.gz CMake-5ec69eb58c4d863e9f8f278b7c78d08f8cedd3f4.tar.bz2 |
cppdap: Build as part of CMake or use external installation
Add `cm3p/` headers to use the selected copy of the library.
Co-authored-by: Glen Chung <kuchung@microsoft.com>
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/cm3p/cppdap/dap.h | 11 | ||||
-rw-r--r-- | Utilities/cm3p/cppdap/future.h | 11 | ||||
-rw-r--r-- | Utilities/cm3p/cppdap/io.h | 11 | ||||
-rw-r--r-- | Utilities/cm3p/cppdap/optional.h | 11 | ||||
-rw-r--r-- | Utilities/cm3p/cppdap/protocol.h | 11 | ||||
-rw-r--r-- | Utilities/cm3p/cppdap/session.h | 11 | ||||
-rw-r--r-- | Utilities/cm3p/cppdap/types.h | 11 | ||||
-rw-r--r-- | Utilities/cmThirdParty.h.in | 1 | ||||
-rw-r--r-- | Utilities/cmcppdap/CMakeLists.txt | 37 | ||||
-rw-r--r-- | Utilities/cmcppdap/NOTICE | 5 | ||||
-rw-r--r-- | Utilities/cmcppdap/src/jsoncpp_json_serializer.cpp | 2 | ||||
-rw-r--r-- | Utilities/cmcppdap/src/jsoncpp_json_serializer.h | 2 |
12 files changed, 122 insertions, 2 deletions
diff --git a/Utilities/cm3p/cppdap/dap.h b/Utilities/cm3p/cppdap/dap.h new file mode 100644 index 0000000..84fd332 --- /dev/null +++ b/Utilities/cm3p/cppdap/dap.h @@ -0,0 +1,11 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +/* Use the cppdap library configured for CMake. */ +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_CPPDAP +# include <dap/dap.h> // IWYU pragma: export +#else +# include <cmcppdap/include/dap/dap.h> // IWYU pragma: export +#endif diff --git a/Utilities/cm3p/cppdap/future.h b/Utilities/cm3p/cppdap/future.h new file mode 100644 index 0000000..ad45b6b --- /dev/null +++ b/Utilities/cm3p/cppdap/future.h @@ -0,0 +1,11 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +/* Use the cppdap library configured for CMake. */ +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_CPPDAP +# include <dap/future.h> // IWYU pragma: export +#else +# include <cmcppdap/include/dap/future.h> // IWYU pragma: export +#endif diff --git a/Utilities/cm3p/cppdap/io.h b/Utilities/cm3p/cppdap/io.h new file mode 100644 index 0000000..e0401f8 --- /dev/null +++ b/Utilities/cm3p/cppdap/io.h @@ -0,0 +1,11 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +/* Use the cppdap library configured for CMake. */ +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_CPPDAP +# include <dap/io.h> // IWYU pragma: export +#else +# include <cmcppdap/include/dap/io.h> // IWYU pragma: export +#endif diff --git a/Utilities/cm3p/cppdap/optional.h b/Utilities/cm3p/cppdap/optional.h new file mode 100644 index 0000000..777184d --- /dev/null +++ b/Utilities/cm3p/cppdap/optional.h @@ -0,0 +1,11 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +/* Use the cppdap library configured for CMake. */ +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_CPPDAP +# include <dap/optional.h> // IWYU pragma: export +#else +# include <cmcppdap/include/dap/optional.h> // IWYU pragma: export +#endif diff --git a/Utilities/cm3p/cppdap/protocol.h b/Utilities/cm3p/cppdap/protocol.h new file mode 100644 index 0000000..da70369 --- /dev/null +++ b/Utilities/cm3p/cppdap/protocol.h @@ -0,0 +1,11 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +/* Use the cppdap library configured for CMake. */ +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_CPPDAP +# include <dap/protocol.h> // IWYU pragma: export +#else +# include <cmcppdap/include/dap/protocol.h> // IWYU pragma: export +#endif diff --git a/Utilities/cm3p/cppdap/session.h b/Utilities/cm3p/cppdap/session.h new file mode 100644 index 0000000..d4468e7 --- /dev/null +++ b/Utilities/cm3p/cppdap/session.h @@ -0,0 +1,11 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +/* Use the cppdap library configured for CMake. */ +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_CPPDAP +# include <dap/session.h> // IWYU pragma: export +#else +# include <cmcppdap/include/dap/session.h> // IWYU pragma: export +#endif diff --git a/Utilities/cm3p/cppdap/types.h b/Utilities/cm3p/cppdap/types.h new file mode 100644 index 0000000..3fc2a88 --- /dev/null +++ b/Utilities/cm3p/cppdap/types.h @@ -0,0 +1,11 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +/* Use the cppdap library configured for CMake. */ +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_CPPDAP +# include <dap/types.h> // IWYU pragma: export +#else +# include <cmcppdap/include/dap/types.h> // IWYU pragma: export +#endif diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in index bd0edb7..da325b1 100644 --- a/Utilities/cmThirdParty.h.in +++ b/Utilities/cmThirdParty.h.in @@ -3,6 +3,7 @@ #pragma once /* Whether CMake is using its own utility libraries. */ +#cmakedefine CMAKE_USE_SYSTEM_CPPDAP #cmakedefine CMAKE_USE_SYSTEM_CURL #cmakedefine CMAKE_USE_SYSTEM_EXPAT #cmakedefine CMAKE_USE_SYSTEM_KWIML diff --git a/Utilities/cmcppdap/CMakeLists.txt b/Utilities/cmcppdap/CMakeLists.txt new file mode 100644 index 0000000..39f72a2 --- /dev/null +++ b/Utilities/cmcppdap/CMakeLists.txt @@ -0,0 +1,37 @@ +# Disable warnings to avoid changing 3rd party code. +if(CMAKE_CXX_COMPILER_ID MATCHES + "^(GNU|LCC|Clang|AppleClang|IBMClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM|NVHPC)$") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PathScale") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -woffall") +endif() + +add_library(cmcppdap STATIC + src/content_stream.cpp + src/io.cpp + src/jsoncpp_json_serializer.cpp + src/network.cpp + src/null_json_serializer.cpp + src/protocol_events.cpp + src/protocol_requests.cpp + src/protocol_response.cpp + src/protocol_types.cpp + src/session.cpp + src/socket.cpp + src/typeinfo.cpp + src/typeof.cpp +) + +target_compile_definitions(cmcppdap PRIVATE CPPDAP_JSON_JSONCPP=1) +target_include_directories(cmcppdap PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) +set_property(TARGET cmcppdap PROPERTY CXX_CLANG_TIDY "") +set_property(TARGET cmcppdap PROPERTY CXX_INCLUDE_WHAT_YOU_USE "") + +target_link_libraries(cmcppdap PRIVATE JsonCpp::JsonCpp) +if(WIN32) + target_link_libraries(cmcppdap PRIVATE ws2_32) +elseif(NOT APPLE) + target_link_libraries(cmcppdap PRIVATE Threads::Threads) +endif() + +install(FILES NOTICE DESTINATION ${CMAKE_DOC_DIR}/cmcppdap) diff --git a/Utilities/cmcppdap/NOTICE b/Utilities/cmcppdap/NOTICE new file mode 100644 index 0000000..5ad206c --- /dev/null +++ b/Utilities/cmcppdap/NOTICE @@ -0,0 +1,5 @@ +'cppdap' is a C++11 library implementation of the Debug Adapter Protocol. +Version as of 2023-01-06 +Copyright Google LLC + +This product includes software developed at Google. diff --git a/Utilities/cmcppdap/src/jsoncpp_json_serializer.cpp b/Utilities/cmcppdap/src/jsoncpp_json_serializer.cpp index 954b0e5..0d037a9 100644 --- a/Utilities/cmcppdap/src/jsoncpp_json_serializer.cpp +++ b/Utilities/cmcppdap/src/jsoncpp_json_serializer.cpp @@ -16,7 +16,7 @@ #include "null_json_serializer.h" -#include <json/json.h> +#include <cm3p/json/json.h> #include <cstdlib> #include <memory> diff --git a/Utilities/cmcppdap/src/jsoncpp_json_serializer.h b/Utilities/cmcppdap/src/jsoncpp_json_serializer.h index 6bdf6a4..93c510b 100644 --- a/Utilities/cmcppdap/src/jsoncpp_json_serializer.h +++ b/Utilities/cmcppdap/src/jsoncpp_json_serializer.h @@ -19,7 +19,7 @@ #include "dap/serialization.h" #include "dap/types.h" -#include <json/forwards.h> +#include <cm3p/json/forwards.h> namespace dap { namespace json { |