Skip to content

Commit 215e206

Browse files
committed
Make the vcpkg rapidjson dependency conditional on a feature
1 parent 4b9e729 commit 215e206

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ endif()
3737
option(GRAPHQL_BUILD_SCHEMAGEN "Build the schemagen tool." ON)
3838
option(GRAPHQL_BUILD_CLIENTGEN "Build the clientgen tool." ON)
3939
option(GRAPHQL_BUILD_TESTS "Build the tests and sample schema library." ON)
40+
option(GRAPHQL_USE_RAPIDJSON "Use RapidJSON for JSON serialization." ON)
4041

4142
if(GRAPHQL_BUILD_SCHEMAGEN)
4243
list(APPEND VCPKG_MANIFEST_FEATURES "schemagen")
@@ -50,6 +51,10 @@ if(GRAPHQL_BUILD_TESTS)
5051
list(APPEND VCPKG_MANIFEST_FEATURES "tests")
5152
endif()
5253

54+
if(GRAPHQL_USE_RAPIDJSON)
55+
list(APPEND VCPKG_MANIFEST_FEATURES "rapidjson")
56+
endif()
57+
5358
if(GRAPHQL_BUILD_SCHEMAGEN AND GRAPHQL_BUILD_CLIENTGEN)
5459
option(GRAPHQL_UPDATE_SAMPLES "Regenerate the sample schema sources whether or not we're building the tests." ON)
5560

src/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,6 @@ endif()
379379
# You will also need to define how to build the graphqljson library target with your
380380
# implementation, and you should set BUILD_GRAPHQLJSON so that the test dependencies know
381381
# about your version of graphqljson.
382-
option(GRAPHQL_USE_RAPIDJSON "Use RapidJSON for JSON serialization." ON)
383-
384382
if(GRAPHQL_USE_RAPIDJSON)
385383
find_package(RapidJSON CONFIG REQUIRED)
386384

vcpkg.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
"gtest"
2121
]
2222
},
23+
"rapidjson": {
24+
"description": "Build the graphqljson library with RapidJSON.",
25+
"dependencies": [
26+
"rapidjson"
27+
]
28+
},
2329
"update-samples": {
2430
"description": "Regenerate the sample schema sources whether or not we're building the tests.",
2531
"dependencies": [
@@ -41,8 +47,7 @@
4147
}
4248
},
4349
"dependencies": [
44-
"pegtl",
45-
"rapidjson"
50+
"pegtl"
4651
],
4752
"builtin-baseline": "a618637937298060bdbe5fbcfb628eabd1082c8a"
4853
}

0 commit comments

Comments
 (0)