Skip to content

Commit d557b9d

Browse files
authored
Merge pull request #146 from wravery/master
Fix #145
2 parents 54baee1 + e9baddc commit d557b9d

File tree

14 files changed

+208
-9
lines changed

14 files changed

+208
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ with `schemagen`, you can look at [samples/CMakeLists.txt](samples/CMakeLists.tx
9393
```
9494
Usage: schemagen [options] <schema file> <output filename prefix> <output namespace>
9595
Command line options:
96+
--version Print the version number
9697
-? [ --help ] Print the command line options
9798
-v [ --verbose ] Verbose output including generated header names as
9899
well as sources

cmake/SchemaGen.rc.in

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#include <winver.h>
5+
6+
#define SCHEMAGEN_RC_VERSION @SCHEMAGEN_RC_VERSION@
7+
#define SCHEMAGEN_RC_VERSION_STR "@SCHEMAGEN_RC_VERSION_STR@"
8+
9+
#ifndef DEBUG
10+
#define VER_DEBUG 0
11+
#else
12+
#define VER_DEBUG VS_FF_DEBUG
13+
#endif
14+
15+
VS_VERSION_INFO VERSIONINFO
16+
FILEVERSION SCHEMAGEN_RC_VERSION
17+
PRODUCTVERSION SCHEMAGEN_RC_VERSION
18+
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
19+
FILEFLAGS VER_DEBUG
20+
FILEOS VOS__WINDOWS32
21+
FILETYPE VFT_APP
22+
FILESUBTYPE VFT2_UNKNOWN
23+
BEGIN
24+
BLOCK "StringFileInfo"
25+
BEGIN
26+
BLOCK "040904B0"
27+
BEGIN
28+
VALUE "CompanyName", "Microsoft Corporation"
29+
VALUE "FileDescription", "Code generator for https://github.com/microsoft/cppgraphqlgen"
30+
VALUE "FileVersion", SCHEMAGEN_RC_VERSION_STR
31+
VALUE "InternalName", "schemagen"
32+
VALUE "LegalCopyright", "Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License."
33+
VALUE "OriginalFilename", "schemagen.exe"
34+
VALUE "ProductName", "CppGraphQLGen"
35+
VALUE "ProductVersion", SCHEMAGEN_RC_VERSION_STR
36+
END
37+
END
38+
39+
BLOCK "VarFileInfo"
40+
BEGIN
41+
VALUE "Translation", 0x409, 1200
42+
END
43+
END

cmake/Version.h.in

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#pragma once
5+
6+
#ifndef VERSION_H
7+
#define VERSION_H
8+
9+
#include <string_view>
10+
11+
namespace graphql::internal {
12+
13+
constexpr std::string_view FullVersion { "@PROJECT_VERSION@" };
14+
15+
constexpr size_t MajorVersion = @PROJECT_VERSION_MAJOR@;
16+
constexpr size_t MinorVersion = @PROJECT_VERSION_MINOR@;
17+
constexpr size_t PatchVersion = @PROJECT_VERSION_PATCH@;
18+
19+
} // namespace graphql::internal
20+
21+
#endif // VERSION_H

cmake/Version.rc.in

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#include <winver.h>
5+
6+
#define GRAPHQL_RC_VERSION @GRAPHQL_RC_VERSION@
7+
#define GRAPHQL_RC_VERSION_STR "@GRAPHQL_RC_VERSION_STR@"
8+
9+
#ifndef DEBUG
10+
#define VER_DEBUG 0
11+
#else
12+
#define VER_DEBUG VS_FF_DEBUG
13+
#endif
14+
15+
VS_VERSION_INFO VERSIONINFO
16+
FILEVERSION GRAPHQL_RC_VERSION
17+
PRODUCTVERSION GRAPHQL_RC_VERSION
18+
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
19+
FILEFLAGS VER_DEBUG
20+
FILEOS VOS__WINDOWS32
21+
FILETYPE VFT_DLL
22+
FILESUBTYPE VFT2_UNKNOWN
23+
BEGIN
24+
BLOCK "StringFileInfo"
25+
BEGIN
26+
BLOCK "040904B0"
27+
BEGIN
28+
VALUE "CompanyName", "Microsoft Corporation"
29+
VALUE "FileDescription", "Shared library for https://github.com/microsoft/cppgraphqlgen"
30+
VALUE "FileVersion", GRAPHQL_RC_VERSION_STR
31+
VALUE "InternalName", "@GRAPHQL_RC_FILENAME@"
32+
VALUE "LegalCopyright", "Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License."
33+
VALUE "OriginalFilename", "@GRAPHQL_RC_FILENAME@.dll"
34+
VALUE "ProductName", "CppGraphQLGen"
35+
VALUE "ProductVersion", GRAPHQL_RC_VERSION_STR
36+
END
37+
END
38+
39+
BLOCK "VarFileInfo"
40+
BEGIN
41+
VALUE "Translation", 0x409, 1200
42+
END
43+
END

cmake/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.4.0
1+
3.4.1

include/graphqlservice/GraphQLService.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020

2121
#include "graphqlservice/GraphQLParse.h"
2222
#include "graphqlservice/GraphQLResponse.h"
23+
2324
#include "graphqlservice/internal/SortedMap.h"
25+
#include "graphqlservice/internal/Version.h"
2426

2527
#include <functional>
2628
#include <future>

samples/introspection/IntrospectionSchema.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include "graphqlservice/GraphQLSchema.h"
1010
#include "graphqlservice/GraphQLService.h"
1111

12+
// Check if the library version is compatible with schemagen 3.4.1
13+
static_assert(graphql::internal::MajorVersion == 3, "regenerate with schemagen: major version mismatch");
14+
static_assert(graphql::internal::MinorVersion == 4, "regenerate with schemagen: minor version mismatch");
15+
1216
// clang-format off
1317
#ifdef GRAPHQL_DLLEXPORTS
1418
#ifdef IMPL_GRAPHQLINTROSPECTION_DLL

samples/separate/TodaySchema.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include "graphqlservice/GraphQLSchema.h"
1010
#include "graphqlservice/GraphQLService.h"
1111

12+
// Check if the library version is compatible with schemagen 3.4.1
13+
static_assert(graphql::internal::MajorVersion == 3, "regenerate with schemagen: major version mismatch");
14+
static_assert(graphql::internal::MinorVersion == 4, "regenerate with schemagen: minor version mismatch");
15+
1216
#include <memory>
1317
#include <string>
1418
#include <vector>

samples/separate_nointrospection/TodaySchema.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include "graphqlservice/GraphQLSchema.h"
1010
#include "graphqlservice/GraphQLService.h"
1111

12+
// Check if the library version is compatible with schemagen 3.4.1
13+
static_assert(graphql::internal::MajorVersion == 3, "regenerate with schemagen: major version mismatch");
14+
static_assert(graphql::internal::MinorVersion == 4, "regenerate with schemagen: minor version mismatch");
15+
1216
#include <memory>
1317
#include <string>
1418
#include <vector>

samples/unified/TodaySchema.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include "graphqlservice/GraphQLSchema.h"
1010
#include "graphqlservice/GraphQLService.h"
1111

12+
// Check if the library version is compatible with schemagen 3.4.1
13+
static_assert(graphql::internal::MajorVersion == 3, "regenerate with schemagen: major version mismatch");
14+
static_assert(graphql::internal::MinorVersion == 4, "regenerate with schemagen: minor version mismatch");
15+
1216
#include <memory>
1317
#include <string>
1418
#include <vector>

0 commit comments

Comments
 (0)