diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 486542c4..58921f51 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -3,13 +3,13 @@ name: Linux on: [push, pull_request] jobs: - gcc10: + gcc14: strategy: fail-fast: false matrix: config: [Debug, Release] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4.1.3 @@ -19,7 +19,10 @@ jobs: - name: Install Dependencies run: | sudo apt-get update - sudo apt-get install -yq libgtest-dev libboost-program-options-dev rapidjson-dev ninja-build gcc-10 g++-10 + sudo apt-get upgrade + sudo add-apt-repository -y universe + sudo apt-get update + sudo apt-get install -yq libgtest-dev libboost-program-options-dev rapidjson-dev ninja-build gcc-14 g++-14 - name: Build GTest run: | @@ -35,8 +38,8 @@ jobs: - name: Configure CMake shell: pwsh env: - CC: gcc-10 - CXX: g++-10 + CC: gcc-14 + CXX: g++-14 working-directory: build/ run: | $cmakeBuildType = '${{ matrix.config }}' diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 16b94358..70cea90b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -9,19 +9,22 @@ jobs: matrix: config: [Debug, Release] - runs-on: macos-13 + runs-on: macos-latest steps: - uses: actions/checkout@v4.1.3 with: submodules: true + fetch-depth: 0 + + - uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 - name: Cache vcpkg uses: actions/cache@v4.0.2 id: cache-vcpkg with: path: build/vcpkg_cache/ - key: vcpkg-binaries-x64-osx + key: vcpkg-binaries-osx-${{ hashFiles('vcpkg.json') }} - name: Create Build Environment if: ${{ !steps.cache-vcpkg.outputs.cache-hit }} @@ -29,18 +32,28 @@ jobs: cmake -E make_directory build cmake -E make_directory build/vcpkg_cache + - name: Boostrap vcpkg + shell: pwsh + working-directory: vcpkg/ + run: | + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + - name: Configure shell: pwsh + env: + VCPKG_ROOT: ${{ github.workspace }}/vcpkg working-directory: build/ run: | - $vcpkgToolchain = Join-Path $env:VCPKG_INSTALLATION_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve + $vcpkgToolchain = Join-Path $env:VCPKG_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve $cmakeBuildType = '${{ matrix.config }}' $cachedBinaries = Join-Path $(Get-Location) './vcpkg_cache/' -Resolve $cacheAccess = $(if ('${{ steps.cache-vcpkg.outputs.cache-hit }}' -eq 'true') { 'read' } else { 'write' }) $env:VCPKG_BINARY_SOURCES = "clear;files,$cachedBinaries,$cacheAccess" - cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" "-DCMAKE_BUILD_TYPE=$cmakeBuildType" ${{ github.workspace }} + $env:PATH = "${env:PATH}:${{ github.workspace }}/ninja-build" + cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" "-DCMAKE_BUILD_TYPE=$cmakeBuildType" -G Ninja ${{ github.workspace }} - name: Build working-directory: build/ diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3e3796bf..cd638c24 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -17,6 +17,7 @@ jobs: - uses: actions/checkout@v4.1.3 with: submodules: true + fetch-depth: 0 - name: Set target triplet id: set-variables @@ -28,7 +29,7 @@ jobs: id: cache-vcpkg with: path: build/vcpkg_cache/ - key: vcpkg-binaries-${{ steps.set-variables.outputs.vcpkg_triplet }} + key: vcpkg-binaries-${{ steps.set-variables.outputs.vcpkg_triplet }}-${{ hashFiles('vcpkg.json') }} - name: Create Build Environment if: ${{ !steps.cache-vcpkg.outputs.cache-hit }} @@ -36,11 +37,20 @@ jobs: cmake -E make_directory build cmake -E make_directory build/vcpkg_cache + - name: Boostrap vcpkg + shell: pwsh + working-directory: vcpkg/ + run: | + ./bootstrap-vcpkg.bat + ./vcpkg integrate install + - name: Configure shell: pwsh + env: + VCPKG_ROOT: ${{ github.workspace }}\vcpkg working-directory: build/ run: | - $vcpkgToolchain = Join-Path $env:VCPKG_INSTALLATION_ROOT '.\scripts\buildsystems\vcpkg.cmake' -Resolve + $vcpkgToolchain = Join-Path $env:VCPKG_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve $vcpkgTriplet = '${{ steps.set-variables.outputs.vcpkg_triplet }}' $cmakeSharedLibs = $(if ('${{ matrix.libs }}' -eq 'shared') { 'ON' } else { 'OFF' }) $msbuildArch = $(if ('${{ matrix.arch }}' -eq 'x64') { 'X64' } else { 'Win32' }) diff --git a/.gitmodules b/.gitmodules index 63c116a4..425cae62 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "PEGTL"] path = PEGTL url = https://github.com/taocpp/PEGTL.git +[submodule "vcpkg"] + path = vcpkg + url = https://github.com/microsoft/vcpkg.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f25e927..4c6440dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,13 +1,12 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) -# Enable CMAKE_MSVC_RUNTIME_LIBRARY on Windows: https://cmake.org/cmake/help/latest/policy/CMP0091.html -cmake_policy(SET CMP0091 NEW) - -# Do not set default MSVC warning flags: https://cmake.org/cmake/help/latest/policy/CMP0092.html -cmake_policy(SET CMP0092 NEW) +if(POLICY CMP0167) + # Prefer the upstream BoostConfig.cmake file instead of the builtin FindBoost module: https://cmake.org/cmake/help/latest/policy/CMP0167.html + cmake_policy(SET CMP0167 NEW) +endif() # Export compile commands for other tools, e.g. SonarLint. set(CMAKE_EXPORT_COMPILE_COMMANDS ON) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 1db60cea..1fdaf4a5 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Enable version checks in find_package include(CMakePackageConfigHelpers) diff --git a/include/graphqlservice/GraphQLClient.h b/include/graphqlservice/GraphQLClient.h index 1321c1b4..2aa7835d 100644 --- a/include/graphqlservice/GraphQLClient.h +++ b/include/graphqlservice/GraphQLClient.h @@ -6,21 +6,10 @@ #ifndef GRAPHQLCLIENT_H #define GRAPHQLCLIENT_H -// clang-format off -#ifdef GRAPHQL_DLLEXPORTS - #ifdef IMPL_GRAPHQLCLIENT_DLL - #define GRAPHQLCLIENT_EXPORT __declspec(dllexport) - #else // !IMPL_GRAPHQLCLIENT_DLL - #define GRAPHQLCLIENT_EXPORT __declspec(dllimport) - #endif // !IMPL_GRAPHQLCLIENT_DLL -#else // !GRAPHQL_DLLEXPORTS - #define GRAPHQLCLIENT_EXPORT -#endif // !GRAPHQL_DLLEXPORTS -// clang-format on - -#include "graphqlservice/GraphQLResponse.h" - -#include "graphqlservice/internal/Version.h" +#include "GraphQLResponse.h" + +#include "internal/Version.h" +#include "internal/DllExports.h" #include #include diff --git a/include/graphqlservice/GraphQLParse.h b/include/graphqlservice/GraphQLParse.h index e983b224..cfd8682f 100644 --- a/include/graphqlservice/GraphQLParse.h +++ b/include/graphqlservice/GraphQLParse.h @@ -6,17 +6,7 @@ #ifndef GRAPHQLPARSE_H #define GRAPHQLPARSE_H -// clang-format off -#ifdef GRAPHQL_DLLEXPORTS - #ifdef IMPL_GRAPHQLPEG_DLL - #define GRAPHQLPEG_EXPORT __declspec(dllexport) - #else // !IMPL_GRAPHQLPEG_DLL - #define GRAPHQLPEG_EXPORT __declspec(dllimport) - #endif // !IMPL_GRAPHQLPEG_DLL -#else // !GRAPHQL_DLLEXPORTS - #define GRAPHQLPEG_EXPORT -#endif // !GRAPHQL_DLLEXPORTS -// clang-format on +#include "internal/DllExports.h" #include #include diff --git a/include/graphqlservice/GraphQLResponse.h b/include/graphqlservice/GraphQLResponse.h index 5ff8cb07..b8249926 100644 --- a/include/graphqlservice/GraphQLResponse.h +++ b/include/graphqlservice/GraphQLResponse.h @@ -6,19 +6,8 @@ #ifndef GRAPHQLRESPONSE_H #define GRAPHQLRESPONSE_H -// clang-format off -#ifdef GRAPHQL_DLLEXPORTS - #ifdef IMPL_GRAPHQLRESPONSE_DLL - #define GRAPHQLRESPONSE_EXPORT __declspec(dllexport) - #else // !IMPL_GRAPHQLRESPONSE_DLL - #define GRAPHQLRESPONSE_EXPORT __declspec(dllimport) - #endif // !IMPL_GRAPHQLRESPONSE_DLL -#else // !GRAPHQL_DLLEXPORTS - #define GRAPHQLRESPONSE_EXPORT -#endif // !GRAPHQL_DLLEXPORTS -// clang-format on - -#include "graphqlservice/internal/Awaitable.h" +#include "internal/Awaitable.h" +#include "internal/DllExports.h" #include #include diff --git a/include/graphqlservice/GraphQLService.h b/include/graphqlservice/GraphQLService.h index 0e7f2ea6..a412b1a4 100644 --- a/include/graphqlservice/GraphQLService.h +++ b/include/graphqlservice/GraphQLService.h @@ -6,24 +6,13 @@ #ifndef GRAPHQLSERVICE_H #define GRAPHQLSERVICE_H -// clang-format off -#ifdef GRAPHQL_DLLEXPORTS - #ifdef IMPL_GRAPHQLSERVICE_DLL - #define GRAPHQLSERVICE_EXPORT __declspec(dllexport) - #else // !IMPL_GRAPHQLSERVICE_DLL - #define GRAPHQLSERVICE_EXPORT __declspec(dllimport) - #endif // !IMPL_GRAPHQLSERVICE_DLL -#else // !GRAPHQL_DLLEXPORTS - #define GRAPHQLSERVICE_EXPORT -#endif // !GRAPHQL_DLLEXPORTS -// clang-format on - -#include "graphqlservice/GraphQLParse.h" -#include "graphqlservice/GraphQLResponse.h" - -#include "graphqlservice/internal/Awaitable.h" -#include "graphqlservice/internal/SortedMap.h" -#include "graphqlservice/internal/Version.h" +#include "GraphQLParse.h" +#include "GraphQLResponse.h" + +#include "internal/Awaitable.h" +#include "internal/DllExports.h" +#include "internal/SortedMap.h" +#include "internal/Version.h" #include #include diff --git a/include/graphqlservice/JSONResponse.h b/include/graphqlservice/JSONResponse.h index c264fd82..aeb8609c 100644 --- a/include/graphqlservice/JSONResponse.h +++ b/include/graphqlservice/JSONResponse.h @@ -6,19 +6,9 @@ #ifndef JSONRESPONSE_H #define JSONRESPONSE_H -// clang-format off -#ifdef GRAPHQL_DLLEXPORTS - #ifdef IMPL_JSONRESPONSE_DLL - #define JSONRESPONSE_EXPORT __declspec(dllexport) - #else // !IMPL_JSONRESPONSE_DLL - #define JSONRESPONSE_EXPORT __declspec(dllimport) - #endif // !IMPL_JSONRESPONSE_DLL -#else // !GRAPHQL_DLLEXPORTS - #define JSONRESPONSE_EXPORT -#endif // !GRAPHQL_DLLEXPORTS -// clang-format on - -#include "graphqlservice/GraphQLResponse.h" +#include "GraphQLResponse.h" + +#include "internal/DllExports.h" namespace graphql::response { diff --git a/include/graphqlservice/internal/Base64.h b/include/graphqlservice/internal/Base64.h index 163e1e84..5aaf1713 100644 --- a/include/graphqlservice/internal/Base64.h +++ b/include/graphqlservice/internal/Base64.h @@ -6,17 +6,7 @@ #ifndef GRAPHQLBASE64_H #define GRAPHQLBASE64_H -// clang-format off -#ifdef GRAPHQL_DLLEXPORTS - #ifdef IMPL_GRAPHQLRESPONSE_DLL - #define GRAPHQLRESPONSE_EXPORT __declspec(dllexport) - #else // !IMPL_GRAPHQLRESPONSE_DLL - #define GRAPHQLRESPONSE_EXPORT __declspec(dllimport) - #endif // !IMPL_GRAPHQLRESPONSE_DLL -#else // !GRAPHQL_DLLEXPORTS - #define GRAPHQLRESPONSE_EXPORT -#endif // !GRAPHQL_DLLEXPORTS -// clang-format on +#include "DllExports.h" #include #include diff --git a/include/graphqlservice/internal/DllExports.h b/include/graphqlservice/internal/DllExports.h new file mode 100644 index 00000000..b6cbfb39 --- /dev/null +++ b/include/graphqlservice/internal/DllExports.h @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma once + +#ifndef DLLEXPORTS_H +#define DLLEXPORTS_H + +// clang-format off +#ifdef GRAPHQL_DLLEXPORTS + #ifdef IMPL_GRAPHQLCLIENT_DLL + #define GRAPHQLCLIENT_EXPORT __declspec(dllexport) + #else // !IMPL_GRAPHQLCLIENT_DLL + #define GRAPHQLCLIENT_EXPORT __declspec(dllimport) + #endif // !IMPL_GRAPHQLCLIENT_DLL + + #ifdef IMPL_GRAPHQLPEG_DLL + #define GRAPHQLPEG_EXPORT __declspec(dllexport) + #else // !IMPL_GRAPHQLPEG_DLL + #define GRAPHQLPEG_EXPORT __declspec(dllimport) + #endif // !IMPL_GRAPHQLPEG_DLL + + #ifdef IMPL_GRAPHQLRESPONSE_DLL + #define GRAPHQLRESPONSE_EXPORT __declspec(dllexport) + #else // !IMPL_GRAPHQLRESPONSE_DLL + #define GRAPHQLRESPONSE_EXPORT __declspec(dllimport) + #endif // !IMPL_GRAPHQLRESPONSE_DLL + + #ifdef IMPL_GRAPHQLSERVICE_DLL + #define GRAPHQLSERVICE_EXPORT __declspec(dllexport) + #else // !IMPL_GRAPHQLSERVICE_DLL + #define GRAPHQLSERVICE_EXPORT __declspec(dllimport) + #endif // !IMPL_GRAPHQLSERVICE_DLL + + #ifdef IMPL_JSONRESPONSE_DLL + #define JSONRESPONSE_EXPORT __declspec(dllexport) + #else // !IMPL_JSONRESPONSE_DLL + #define JSONRESPONSE_EXPORT __declspec(dllimport) + #endif // !IMPL_JSONRESPONSE_DLL +#else // !GRAPHQL_DLLEXPORTS + #define GRAPHQLCLIENT_EXPORT + #define GRAPHQLPEG_EXPORT + #define GRAPHQLRESPONSE_EXPORT + #define GRAPHQLSERVICE_EXPORT + #define JSONRESPONSE_EXPORT +#endif // !GRAPHQL_DLLEXPORTS +// clang-format on + +#endif // DLLEXPORTS_H diff --git a/include/graphqlservice/internal/Grammar.h b/include/graphqlservice/internal/Grammar.h index 8f3824b1..89bfe0a2 100644 --- a/include/graphqlservice/internal/Grammar.h +++ b/include/graphqlservice/internal/Grammar.h @@ -9,7 +9,7 @@ #ifndef GRAPHQLGRAMMAR_H #define GRAPHQLGRAMMAR_H -#include "graphqlservice/internal/SyntaxTree.h" +#include "SyntaxTree.h" #include diff --git a/include/graphqlservice/internal/Introspection.h b/include/graphqlservice/internal/Introspection.h index 885af384..e7b926f1 100644 --- a/include/graphqlservice/internal/Introspection.h +++ b/include/graphqlservice/internal/Introspection.h @@ -8,7 +8,8 @@ #include "graphqlservice/introspection/IntrospectionSchema.h" -#include "graphqlservice/internal/Schema.h" +#include "DllExports.h" +#include "Schema.h" namespace graphql::introspection { diff --git a/include/graphqlservice/internal/Schema.h b/include/graphqlservice/internal/Schema.h index 24480943..bdc87926 100644 --- a/include/graphqlservice/internal/Schema.h +++ b/include/graphqlservice/internal/Schema.h @@ -6,9 +6,15 @@ #ifndef GRAPHQLSCHEMA_H #define GRAPHQLSCHEMA_H -#include "graphqlservice/GraphQLService.h" +#include "DllExports.h" +#include "SortedMap.h" +#include "Version.h" +#include +#include #include +#include +#include namespace graphql { namespace introspection { diff --git a/include/graphqlservice/internal/SyntaxTree.h b/include/graphqlservice/internal/SyntaxTree.h index 7e9be03a..fad8ef41 100644 --- a/include/graphqlservice/internal/SyntaxTree.h +++ b/include/graphqlservice/internal/SyntaxTree.h @@ -6,7 +6,7 @@ #ifndef GRAPHQLSYNTAXTREE_H #define GRAPHQLSYNTAXTREE_H -#include "graphqlservice/GraphQLParse.h" +#include "DllExports.h" #define TAO_PEGTL_NAMESPACE tao::graphqlpeg diff --git a/include/graphqlservice/introspection/IntrospectionSchema.h b/include/graphqlservice/introspection/IntrospectionSchema.h index 4adaa9af..363d67f2 100644 --- a/include/graphqlservice/introspection/IntrospectionSchema.h +++ b/include/graphqlservice/introspection/IntrospectionSchema.h @@ -8,6 +8,9 @@ #ifndef INTROSPECTIONSCHEMA_H #define INTROSPECTIONSCHEMA_H +#include "graphqlservice/GraphQLResponse.h" +#include "graphqlservice/GraphQLService.h" + #include "graphqlservice/internal/Schema.h" // Check if the library version is compatible with schemagen 4.5.0 diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index bddfd792..99131474 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) add_subdirectory(client) add_subdirectory(learn) @@ -15,7 +15,7 @@ if(GRAPHQL_BUILD_HTTP_SAMPLE) try_compile(TEST_RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/test_boost_beast.cpp - CMAKE_FLAGS -DINCLUDE_DIRECTORIES:STRING=${Boost_INCLUDE_DIR} + CMAKE_FLAGS -DINCLUDE_DIRECTORIES:STRING=${Boost_INCLUDE_DIRS} CXX_STANDARD 20) if(TEST_RESULT) diff --git a/samples/client/CMakeLists.txt b/samples/client/CMakeLists.txt index 71ff74de..b5eb0d8a 100644 --- a/samples/client/CMakeLists.txt +++ b/samples/client/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) add_subdirectory(query) add_subdirectory(mutate) diff --git a/samples/client/benchmark/CMakeLists.txt b/samples/client/benchmark/CMakeLists.txt index ea0ab74c..c2ec979e 100644 --- a/samples/client/benchmark/CMakeLists.txt +++ b/samples/client/benchmark/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/client/multiple/CMakeLists.txt b/samples/client/multiple/CMakeLists.txt index d011f933..9f72d51d 100644 --- a/samples/client/multiple/CMakeLists.txt +++ b/samples/client/multiple/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/client/mutate/CMakeLists.txt b/samples/client/mutate/CMakeLists.txt index 61b3ab67..bdf63420 100644 --- a/samples/client/mutate/CMakeLists.txt +++ b/samples/client/mutate/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/client/nestedinput/CMakeLists.txt b/samples/client/nestedinput/CMakeLists.txt index b9714ed2..470a7c71 100644 --- a/samples/client/nestedinput/CMakeLists.txt +++ b/samples/client/nestedinput/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/client/query/CMakeLists.txt b/samples/client/query/CMakeLists.txt index dd483b6c..6fbcfcc1 100644 --- a/samples/client/query/CMakeLists.txt +++ b/samples/client/query/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/client/subscribe/CMakeLists.txt b/samples/client/subscribe/CMakeLists.txt index fb3ea5eb..6d937548 100644 --- a/samples/client/subscribe/CMakeLists.txt +++ b/samples/client/subscribe/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/learn/CMakeLists.txt b/samples/learn/CMakeLists.txt index 3be7bcf0..7c0db253 100644 --- a/samples/learn/CMakeLists.txt +++ b/samples/learn/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) add_subdirectory(schema) add_library(star_wars STATIC diff --git a/samples/learn/schema/CMakeLists.txt b/samples/learn/schema/CMakeLists.txt index 2cab0cc0..589e3b6a 100644 --- a/samples/learn/schema/CMakeLists.txt +++ b/samples/learn/schema/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/learn/schema/StarWarsSchema.h b/samples/learn/schema/StarWarsSchema.h index 01308601..2511eac0 100644 --- a/samples/learn/schema/StarWarsSchema.h +++ b/samples/learn/schema/StarWarsSchema.h @@ -8,6 +8,9 @@ #ifndef STARWARSSCHEMA_H #define STARWARSSCHEMA_H +#include "graphqlservice/GraphQLResponse.h" +#include "graphqlservice/GraphQLService.h" + #include "graphqlservice/internal/Schema.h" // Check if the library version is compatible with schemagen 4.5.0 diff --git a/samples/proxy/CMakeLists.txt b/samples/proxy/CMakeLists.txt index df821c20..e518aca8 100644 --- a/samples/proxy/CMakeLists.txt +++ b/samples/proxy/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) add_subdirectory(query) add_subdirectory(schema) diff --git a/samples/proxy/query/CMakeLists.txt b/samples/proxy/query/CMakeLists.txt index f774c8f8..4c8e5e50 100644 --- a/samples/proxy/query/CMakeLists.txt +++ b/samples/proxy/query/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/proxy/schema/CMakeLists.txt b/samples/proxy/schema/CMakeLists.txt index 03912cd3..bb9a16a1 100644 --- a/samples/proxy/schema/CMakeLists.txt +++ b/samples/proxy/schema/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/proxy/schema/ProxySchema.h b/samples/proxy/schema/ProxySchema.h index c1d565d3..eebe09e9 100644 --- a/samples/proxy/schema/ProxySchema.h +++ b/samples/proxy/schema/ProxySchema.h @@ -8,6 +8,9 @@ #ifndef PROXYSCHEMA_H #define PROXYSCHEMA_H +#include "graphqlservice/GraphQLResponse.h" +#include "graphqlservice/GraphQLService.h" + #include "graphqlservice/internal/Schema.h" // Check if the library version is compatible with schemagen 4.5.0 diff --git a/samples/today/CMakeLists.txt b/samples/today/CMakeLists.txt index 7c9eaa33..c3b9b2bb 100644 --- a/samples/today/CMakeLists.txt +++ b/samples/today/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # todaygraphql add_subdirectory(schema) diff --git a/samples/today/nointrospection/CMakeLists.txt b/samples/today/nointrospection/CMakeLists.txt index 5bea126a..5f98c0c0 100644 --- a/samples/today/nointrospection/CMakeLists.txt +++ b/samples/today/nointrospection/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/today/nointrospection/TodaySchema.h b/samples/today/nointrospection/TodaySchema.h index ebcd3905..ef18f867 100644 --- a/samples/today/nointrospection/TodaySchema.h +++ b/samples/today/nointrospection/TodaySchema.h @@ -8,6 +8,9 @@ #ifndef TODAYSCHEMA_H #define TODAYSCHEMA_H +#include "graphqlservice/GraphQLResponse.h" +#include "graphqlservice/GraphQLService.h" + #include "graphqlservice/internal/Schema.h" // Check if the library version is compatible with schemagen 4.5.0 diff --git a/samples/today/schema/CMakeLists.txt b/samples/today/schema/CMakeLists.txt index 0c6403ec..e7e7ee23 100644 --- a/samples/today/schema/CMakeLists.txt +++ b/samples/today/schema/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/today/schema/TodaySchema.h b/samples/today/schema/TodaySchema.h index ebcd3905..ef18f867 100644 --- a/samples/today/schema/TodaySchema.h +++ b/samples/today/schema/TodaySchema.h @@ -8,6 +8,9 @@ #ifndef TODAYSCHEMA_H #define TODAYSCHEMA_H +#include "graphqlservice/GraphQLResponse.h" +#include "graphqlservice/GraphQLService.h" + #include "graphqlservice/internal/Schema.h" // Check if the library version is compatible with schemagen 4.5.0 diff --git a/samples/validation/CMakeLists.txt b/samples/validation/CMakeLists.txt index 8db4b408..5968f24b 100644 --- a/samples/validation/CMakeLists.txt +++ b/samples/validation/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) if(GRAPHQL_BUILD_TESTS) add_subdirectory(schema) diff --git a/samples/validation/schema/CMakeLists.txt b/samples/validation/schema/CMakeLists.txt index 106fad47..4d680f6c 100644 --- a/samples/validation/schema/CMakeLists.txt +++ b/samples/validation/schema/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/cppgraphqlgen-functions.cmake) diff --git a/samples/validation/schema/ValidationSchema.h b/samples/validation/schema/ValidationSchema.h index be93c2b8..66208163 100644 --- a/samples/validation/schema/ValidationSchema.h +++ b/samples/validation/schema/ValidationSchema.h @@ -8,6 +8,9 @@ #ifndef VALIDATIONSCHEMA_H #define VALIDATIONSCHEMA_H +#include "graphqlservice/GraphQLResponse.h" +#include "graphqlservice/GraphQLService.h" + #include "graphqlservice/internal/Schema.h" // Check if the library version is compatible with schemagen 4.5.0 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2d763474..6bab8b34 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) if(GRAPHQL_UPDATE_VERSION) # internal/Version.h diff --git a/src/SchemaGenerator.cpp b/src/SchemaGenerator.cpp index 59c41549..6feaea8d 100644 --- a/src/SchemaGenerator.cpp +++ b/src/SchemaGenerator.cpp @@ -109,7 +109,10 @@ bool Generator::outputHeader() const noexcept IncludeGuardScope includeGuard { headerFile, std::filesystem::path(_headerPath).filename().string() }; - headerFile << R"cpp(#include "graphqlservice/internal/Schema.h" + headerFile << R"cpp(#include "graphqlservice/GraphQLResponse.h" +#include "graphqlservice/GraphQLService.h" + +#include "graphqlservice/internal/Schema.h" // Check if the library version is compatible with schemagen )cpp" << graphql::internal::MajorVersion << R"cpp(.)cpp" << graphql::internal::MinorVersion diff --git a/src/introspection/CMakeLists.txt b/src/introspection/CMakeLists.txt index 82b8203d..329b95a7 100644 --- a/src/introspection/CMakeLists.txt +++ b/src/introspection/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) # Normally this would be handled by find_package(cppgraphqlgen CONFIG). include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/cppgraphqlgen-functions.cmake) diff --git a/src/introspection/IntrospectionSchema.h b/src/introspection/IntrospectionSchema.h index 4adaa9af..363d67f2 100644 --- a/src/introspection/IntrospectionSchema.h +++ b/src/introspection/IntrospectionSchema.h @@ -8,6 +8,9 @@ #ifndef INTROSPECTIONSCHEMA_H #define INTROSPECTIONSCHEMA_H +#include "graphqlservice/GraphQLResponse.h" +#include "graphqlservice/GraphQLService.h" + #include "graphqlservice/internal/Schema.h" // Check if the library version is compatible with schemagen 4.5.0 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a3b0d52f..9e0a8150 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.28) find_package(GTest MODULE REQUIRED) diff --git a/vcpkg b/vcpkg new file mode 160000 index 00000000..7aeffc91 --- /dev/null +++ b/vcpkg @@ -0,0 +1 @@ +Subproject commit 7aeffc91033ad35cc4e2c152f213a866ec6c11ac