Skip to content

Commit e2adbe7

Browse files
Merge pull request #4 from carbonengine/use-public-vcpkg-registry
Use public vcpkg registry
2 parents 199e550 + dfa1cd5 commit e2adbe7

4 files changed

Lines changed: 86 additions & 38 deletions

File tree

CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ include(cmake/CcpTargetConfigurations.cmake)
99
include(cmake/CcpDocsGenerator.cmake)
1010

1111
find_package(yaml-cpp CONFIG REQUIRED)
12-
find_package(Python3 COMPONENTS Interpreter REQUIRED)
1312

1413
# Add subdirectory for resource tools static library
1514
add_subdirectory(tools)
@@ -104,10 +103,14 @@ target_include_directories(resources-static
104103

105104
add_subdirectory(cli)
106105

107-
enable_testing()
108-
109-
add_subdirectory(tests)
110-
106+
# Enable testing based on option set (on by default)
107+
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
108+
option(BUILD_TESTING "Build and run tests. Enabled by default." ON)
109+
if (BUILD_TESTING)
110+
include(CTest)
111+
add_subdirectory(tests)
112+
endif ()
113+
endif ()
111114

112115
# Provide an install target if this is the top level project only
113116
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
@@ -123,6 +126,8 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
123126
option(BUILD_DOCUMENTATION "Build Documentation" ${BUILD_DOCUMENTATION_DEFAULT_FLAG})
124127

125128
if (BUILD_DOCUMENTATION)
129+
find_package(Python3 COMPONENTS Interpreter REQUIRED)
130+
126131
# Run sphinx
127132
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/doc/source)
128133
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/doc/build)

CMakePresets.json

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"cacheVariables": {
1818
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON",
1919
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake/triplets",
20-
"VCPKG_TARGET_TRIPLET": "x64-windows-carbon"
20+
"VCPKG_TARGET_TRIPLET": "x64-windows-carbon",
21+
"VCPKG_HOST_TRIPLET": "x64-windows-carbon"
2122
},
2223
"environment": {
2324
"X_VCPKG_REGISTRIES_CACHE": "${sourceDir}/vcpkg_registry_cache"
@@ -31,7 +32,8 @@
3132
"cacheVariables": {
3233
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON",
3334
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake/triplets",
34-
"VCPKG_TARGET_TRIPLET": "x64-windows-carbon"
35+
"VCPKG_TARGET_TRIPLET": "x64-windows-carbon",
36+
"VCPKG_HOST_TRIPLET": "x64-windows-carbon"
3537
},
3638
"environment": {
3739
"X_VCPKG_REGISTRIES_CACHE": "${sourceDir}/vcpkg_registry_cache"
@@ -53,11 +55,33 @@
5355
"cacheVariables": {
5456
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON",
5557
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake/triplets",
56-
"VCPKG_TARGET_TRIPLET": "arm64-osx-carbon"
58+
"VCPKG_TARGET_TRIPLET": "arm64-osx-carbon",
59+
"VCPKG_HOST_TRIPLET": "arm64-osx-carbon"
5760
},
5861
"environment": {
5962
"X_VCPKG_REGISTRIES_CACHE": "${sourceDir}/vcpkg_registry_cache"
6063
}
64+
},
65+
{
66+
"name": "ci",
67+
"hidden": true,
68+
"cacheVariables": {
69+
"BUILD_DOCUMENTATION": "ON",
70+
"BUILD_TESTING": "ON",
71+
"VCPKG_MANIFEST_FEATURES": "docs;tests"
72+
}
73+
},
74+
{
75+
"name": "carbon_windows_vcpkg_vs_ci",
76+
"inherits": ["carbon_windows_vcpkg_vs", "ci"]
77+
},
78+
{
79+
"name": "carbon_windows_vcpkg_nmc_ci",
80+
"inherits": ["carbon_windows_vcpkg_nmc", "ci"]
81+
},
82+
{
83+
"name": "carbon_osx_vcpkg_ci",
84+
"inherits": ["carbon_osx_vcpkg", "ci"]
6185
}
6286
]
6387
}

vcpkg-configuration.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"registries": [
88
{
99
"kind": "git",
10-
"repository": "git@github.com:ccpgames/carbon-vcpkg-registry.git",
11-
"baseline": "4089428d25208720dcf6451cb8b57816bbf9fb9d",
12-
"packages": ["carbon-*", "python3-prebuilt", "bsdiff-drake127"]
10+
"repository": "git@github.com:carbonengine/vcpkg-registry.git",
11+
"baseline": "addd8867a1553f4b7866bb7a36deb84bd59bd1f9",
12+
"packages": ["carbon-*", "python3", "bsdiff-drake127"]
1313
}
1414
]
1515
}

vcpkg.json

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,64 @@
11
{
22
"dependencies": [
33
{
4-
"name": "python3-prebuilt",
5-
"version>=": "3.12.3#2"
4+
"name": "argparse",
5+
"version>=": "2.2#0"
66
},
7-
87
{
9-
"name":"argparse",
10-
"version>=":"2.2#0"
8+
"name": "curl",
9+
"version>=": "8.11.1#1"
1110
},
12-
1311
{
14-
"name":"curl"
12+
"name": "cryptopp",
13+
"version>=": "8.9.0#1"
1514
},
16-
1715
{
18-
"name":"gtest"
16+
"name": "yaml-cpp",
17+
"version>=": "0.8.0#1"
1918
},
20-
2119
{
22-
"name":"cryptopp"
20+
"name": "zlib",
21+
"version>=": "1.3.1"
2322
},
24-
2523
{
26-
"name":"tiny-process-library"
27-
},
28-
29-
{
30-
"name":"yaml-cpp"
31-
},
32-
33-
{
34-
"name":"zlib"
35-
},
36-
37-
{
38-
"name":"bsdiff-drake127"
24+
"name": "bsdiff-drake127",
25+
"version>=": "4.3.3"
3926
}
4027
],
41-
28+
"default-features": [
29+
"tests"
30+
],
31+
"features": {
32+
"tests": {
33+
"description": "Enable tests",
34+
"dependencies": [
35+
{
36+
"name": "gtest",
37+
"version>=": "1.15.2",
38+
"host": true
39+
},
40+
{
41+
"name": "tiny-process-library",
42+
"version>=": "2.0.4#3",
43+
"host": true
44+
}
45+
]
46+
},
47+
"docs": {
48+
"description": "Generate documentation",
49+
"dependencies": [
50+
{
51+
"name": "python3",
52+
"version>=": "3.12.3",
53+
"host": true
54+
}
55+
]
56+
}
57+
},
4258
"overrides": [
43-
{ "name": "argparse", "version": "2.2#0" }
59+
{
60+
"name": "argparse",
61+
"version": "2.2#0"
62+
}
4463
]
4564
}

0 commit comments

Comments
 (0)