Skip to content

Commit b3210c8

Browse files
authored
Merge pull request #152 from wravery/main
Add backwards compatibility with PEGTL 3.1.0 and fix the header install paths
2 parents 33232c0 + e8f554d commit b3210c8

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ endfunction()
6666

6767
find_package(Threads MODULE REQUIRED)
6868

69-
find_package(pegtl 3.1.1 QUIET CONFIG)
69+
find_package(pegtl 3.1.0 QUIET CONFIG)
7070
if(NOT pegtl_FOUND)
7171
# If a compatible version of PEGTL is not already installed, build and install it from the submodule directory.
7272
set(PEGTL_BUILD_TESTS OFF CACHE BOOL "Disable PEGTL tests")

include/graphqlservice/GraphQLTree.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
#include <tao/pegtl.hpp>
1414
#include <tao/pegtl/contrib/parse_tree.hpp>
1515

16+
// Temporarily workaround the tao::demangle namespace in 3.1.0. This was fixed in PEGTL commit
17+
// https://github.com/taocpp/PEGTL/commit/0cc3128e07734fb72e23e2eeee70b9f1fc13ca5f, which put this
18+
// in the correct namespace defined by TAO_PEGTL_NAMESPACE (tao::graphqlpeg) and should be included
19+
// in 3.1.1 or later. Once that version of PEGTL is released, this can be removed.
20+
#include <tao/pegtl/version.hpp>
21+
22+
#if (TAO_PEGTL_VERSION_MAJOR == 3) && (TAO_PEGTL_VERSION_MINOR == 1) \
23+
&& (TAO_PEGTL_VERSION_PATCH < 1)
24+
namespace tao::graphqlpeg {
25+
using ::tao::demangle;
26+
}
27+
#endif
28+
1629
#include <string>
1730
#include <string_view>
1831
#include <variant>

src/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ if(BUILD_GRAPHQLJSON)
298298
LIBRARY DESTINATION lib)
299299
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../include/graphqlservice/JSONResponse.h
300300
CONFIGURATIONS ${GRAPHQL_INSTALL_CONFIGURATIONS}
301-
DESTINATION ${GRAPHQL_INSTALL_INCLUDE_DIR}/graphqlintrospection)
301+
DESTINATION ${GRAPHQL_INSTALL_INCLUDE_DIR}/graphqlservice)
302302
else()
303303
set(GRAPHQL_BUILD_TESTS OFF CACHE BOOL "GRAPHQL_BUILD_TESTS depends on BUILD_GRAPHQLJSON" FORCE)
304304
endif()
@@ -321,7 +321,7 @@ install(FILES
321321
${CMAKE_CURRENT_SOURCE_DIR}/../include/graphqlservice/GraphQLGrammar.h
322322
${CMAKE_CURRENT_SOURCE_DIR}/../include/graphqlservice/GraphQLTree.h
323323
CONFIGURATIONS ${GRAPHQL_INSTALL_CONFIGURATIONS}
324-
DESTINATION ${GRAPHQL_INSTALL_INCLUDE_DIR}/graphqlintrospection)
324+
DESTINATION ${GRAPHQL_INSTALL_INCLUDE_DIR}/graphqlservice)
325325

326326
install(FILES
327327
${CMAKE_CURRENT_SOURCE_DIR}/../include/graphqlservice/internal/SortedMap.h
@@ -333,7 +333,7 @@ install(FILES
333333
${CMAKE_CURRENT_SOURCE_DIR}/../include/graphqlservice/introspection/Introspection.h
334334
${CMAKE_CURRENT_SOURCE_DIR}/../include/graphqlservice/introspection/IntrospectionSchema.h
335335
CONFIGURATIONS ${GRAPHQL_INSTALL_CONFIGURATIONS}
336-
DESTINATION ${GRAPHQL_INSTALL_INCLUDE_DIR}/graphqlintrospection/introspection)
336+
DESTINATION ${GRAPHQL_INSTALL_INCLUDE_DIR}/graphqlservice/introspection)
337337

338338
install(EXPORT cppgraphqlgen-targets
339339
NAMESPACE cppgraphqlgen::

0 commit comments

Comments
 (0)