Skip to content

Commit 8a723cb

Browse files
chore(ss-template): update serious-scaffold to v1.6.11 (#14)
Co-authored-by: msclock-bot[bot] <163820484+msclock-bot[bot]@users.noreply.github.com>
1 parent 1368b83 commit 8a723cb

13 files changed

+147
-131
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_commit: v1.6.10
1+
_commit: v1.6.11
22
_src_path: gh:serious-scaffold/ss-cpp
33
author_email: msclock@qq.com
44
author_name: msclock

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pre-commit:
4343
_PRESET_ARGS = --preset $(PRESET)
4444

4545
cmake-configure:
46-
cmake -S . $(_PRESET_ARGS) $(CONFIGURE) $(if $(FRESH_CMAKE_CACHE),--fresh)
46+
cmake -S . $(_PRESET_ARGS) $(CONFIGURE)
4747

4848
cmake-build-template-%:
4949
cmake --build $(_PRESET_ARGS) --target $*
@@ -72,13 +72,13 @@ test-build-test-install: test-build-test cmake-install cmake-uninstall
7272
test-build-test-install-ccov: test-build-test-install cmake-build-template-ccov-all
7373

7474
test-coverage:
75-
$(MAKE) test-build-test-install-ccov CONFIGURE="-DBUILD_TESTING=ON -DCODE_COVERAGE=ON $(CONFIGURE)" FRESH_CMAKE_CACHE=1
75+
$(MAKE) test-build-test-install-ccov CONFIGURE="-DBUILD_TESTING=ON -DCODE_COVERAGE=ON $(CONFIGURE) --fresh"
7676

7777
test-valgrind:
78-
$(MAKE) test-build-memcheck CONFIGURE="-DBUILD_TESTING=ON -DUSE_VALGRIND=ON $(CONFIGURE)" FRESH_CMAKE_CACHE=1
78+
$(MAKE) test-build-memcheck CONFIGURE="-DBUILD_TESTING=ON -DUSE_VALGRIND=ON $(CONFIGURE) --fresh"
7979

8080
test-sanitizer-template-%:
81-
$(MAKE) test-build-test CONFIGURE="-DBUILD_TESTING=ON -DUSE_SANITIZER=$* $(CONFIGURE)" FRESH_CMAKE_CACHE=1
81+
$(MAKE) test-build-test CONFIGURE="-DBUILD_TESTING=ON -DUSE_SANITIZER=$* $(CONFIGURE) --fresh"
8282

8383
test-sanitizer-address: test-sanitizer-template-address
8484

@@ -91,10 +91,10 @@ test-sanitizer-undefined: test-sanitizer-template-undefined
9191
test-sanitizer: test-sanitizer-template-address test-sanitizer-template-leak test-sanitizer-template-memory test-sanitizer-template-undefined
9292

9393
test-cppcheck:
94-
$(MAKE) test-build CONFIGURE="-DBUILD_TESTING=ON -DUSE_CPPCHECK=ON $(CONFIGURE)" FRESH_CMAKE_CACHE=1
94+
$(MAKE) test-build CONFIGURE="-DBUILD_TESTING=ON -DUSE_CPPCHECK=ON $(CONFIGURE) --fresh"
9595

9696
test-clang-tidy:
97-
$(MAKE) test-build CONFIGURE="-DBUILD_TESTING=ON -DUSE_CLANGTIDY=ON $(CONFIGURE)" FRESH_CMAKE_CACHE=1
97+
$(MAKE) test-build CONFIGURE="-DBUILD_TESTING=ON -DUSE_CLANGTIDY=ON $(CONFIGURE) --fresh"
9898

9999
########################################################################################
100100
# Documentation

cmake/presets/base.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@
2020
"CMAKE_BUILD_TYPE": "Debug",
2121
"CMAKE_VERBOSE_MAKEFILE": "FALSE"
2222
}
23+
},
24+
{
25+
"name": "base-config",
26+
"hidden": true,
27+
"inherits": [
28+
"ninja-config",
29+
"vcpkg"
30+
],
31+
"binaryDir": "${sourceDir}/out/build/${presetName}",
32+
"installDir": "${sourceDir}/out/install/${presetName}",
33+
"cacheVariables": {
34+
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
35+
"CMAKE_COMPILE_WARNING_AS_ERROR": false,
36+
"CMAKE_VERBOSE_MAKEFILE": "FALSE"
37+
}
2338
}
2439
],
2540
"buildPresets": [
@@ -28,6 +43,18 @@
2843
"hidden": true,
2944
"inherits": "ninja",
3045
"configurePreset": "base"
46+
},
47+
{
48+
"name": "base-config-relwithdebinfo",
49+
"hidden": true,
50+
"inherits": "ninja-config-relwithdebinfo",
51+
"configurePreset": "base-config"
52+
},
53+
{
54+
"name": "base-config-debug",
55+
"hidden": true,
56+
"inherits": "ninja-config-debug",
57+
"configurePreset": "base-config"
3158
}
3259
],
3360
"testPresets": [
@@ -43,6 +70,32 @@
4370
"noTestsAction": "error",
4471
"stopOnFailure": true
4572
}
73+
},
74+
{
75+
"name": "base-config-relwithdebinfo",
76+
"hidden": true,
77+
"inherits": "ninja-config-relwithdebinfo",
78+
"configurePreset": "base-config",
79+
"output": {
80+
"outputOnFailure": true
81+
},
82+
"execution": {
83+
"noTestsAction": "error",
84+
"stopOnFailure": true
85+
}
86+
},
87+
{
88+
"name": "base-config-debug",
89+
"hidden": true,
90+
"inherits": "ninja-config-debug",
91+
"configurePreset": "base-config",
92+
"output": {
93+
"outputOnFailure": true
94+
},
95+
"execution": {
96+
"noTestsAction": "error",
97+
"stopOnFailure": true
98+
}
4699
}
47100
]
48101
}

cmake/presets/default.json

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,46 @@
99
"inherits": [
1010
"base"
1111
]
12+
},
13+
{
14+
"name": "default-config",
15+
"inherits": [
16+
"base-config"
17+
]
1218
}
1319
],
1420
"buildPresets": [
1521
{
1622
"name": "default",
1723
"inherits": "base",
1824
"configurePreset": "default"
25+
},
26+
{
27+
"name": "default-config-relwithdebinfo",
28+
"inherits": "base-config-relwithdebinfo",
29+
"configurePreset": "default-config"
30+
},
31+
{
32+
"name": "default-config-debug",
33+
"inherits": "base-config-debug",
34+
"configurePreset": "default-config"
1935
}
2036
],
2137
"testPresets": [
2238
{
2339
"name": "default",
2440
"inherits": "base",
2541
"configurePreset": "default"
26-
}
27-
],
28-
"workflowPresets": [
42+
},
2943
{
30-
"name": "default",
31-
"steps": [
32-
{
33-
"type": "configure",
34-
"name": "default"
35-
},
36-
{
37-
"type": "build",
38-
"name": "default"
39-
},
40-
{
41-
"type": "test",
42-
"name": "default"
43-
}
44-
]
44+
"name": "default-config-relwithdebinfo",
45+
"inherits": "base-config-relwithdebinfo",
46+
"configurePreset": "default-config"
47+
},
48+
{
49+
"name": "default-config-debug",
50+
"inherits": "base-config-debug",
51+
"configurePreset": "default-config"
4552
}
4653
]
4754
}

cmake/presets/generators/ninja.json

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"generator": "Ninja"
88
},
99
{
10-
"name": "ninja-multi-config",
10+
"name": "ninja-config",
1111
"hidden": true,
1212
"generator": "Ninja Multi-Config"
1313
}
@@ -19,10 +19,16 @@
1919
"configurePreset": "ninja"
2020
},
2121
{
22-
"name": "ninja-multi-config",
22+
"name": "ninja-config-relwithdebinfo",
2323
"hidden": true,
24-
"configurePreset": "ninja-multi-config",
24+
"configurePreset": "ninja-config",
2525
"configuration": "RelWithDebInfo"
26+
},
27+
{
28+
"name": "ninja-config-debug",
29+
"hidden": true,
30+
"configurePreset": "ninja-config",
31+
"configuration": "Debug"
2632
}
2733
],
2834
"testPresets": [
@@ -32,10 +38,16 @@
3238
"configurePreset": "ninja"
3339
},
3440
{
35-
"name": "ninja-multi-config",
41+
"name": "ninja-config-relwithdebinfo",
3642
"hidden": true,
37-
"configurePreset": "ninja-multi-config",
43+
"configurePreset": "ninja-config",
3844
"configuration": "RelWithDebInfo"
45+
},
46+
{
47+
"name": "ninja-config-debug",
48+
"hidden": true,
49+
"configurePreset": "ninja-config",
50+
"configuration": "Debug"
3951
}
4052
]
4153
}

cmake/presets/x64-linux-gcc.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,5 @@
3030
"inherits": "base",
3131
"configurePreset": "x64-linux-gcc"
3232
}
33-
],
34-
"workflowPresets": [
35-
{
36-
"name": "x64-linux-gcc",
37-
"steps": [
38-
{
39-
"type": "configure",
40-
"name": "x64-linux-gcc"
41-
},
42-
{
43-
"type": "build",
44-
"name": "x64-linux-gcc"
45-
},
46-
{
47-
"type": "test",
48-
"name": "x64-linux-gcc"
49-
}
50-
]
51-
}
5233
]
5334
}

cmake/presets/x64-linux-llvm.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,5 @@
3030
"inherits": "base",
3131
"configurePreset": "x64-linux-llvm"
3232
}
33-
],
34-
"workflowPresets": [
35-
{
36-
"name": "x64-linux-llvm",
37-
"steps": [
38-
{
39-
"type": "configure",
40-
"name": "x64-linux-llvm"
41-
},
42-
{
43-
"type": "build",
44-
"name": "x64-linux-llvm"
45-
},
46-
{
47-
"type": "test",
48-
"name": "x64-linux-llvm"
49-
}
50-
]
51-
}
5233
]
5334
}

cmake/presets/x64-mingw-dynamic-windows-mingw.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,5 @@
3131
"inherits": "base",
3232
"configurePreset": "x64-mingw-dynamic-windows-mingw"
3333
}
34-
],
35-
"workflowPresets": [
36-
{
37-
"name": "x64-mingw-dynamic-windows-mingw",
38-
"steps": [
39-
{
40-
"type": "configure",
41-
"name": "x64-mingw-dynamic-windows-mingw"
42-
},
43-
{
44-
"type": "build",
45-
"name": "x64-mingw-dynamic-windows-mingw"
46-
},
47-
{
48-
"type": "test",
49-
"name": "x64-mingw-dynamic-windows-mingw"
50-
}
51-
]
52-
}
5334
]
5435
}

cmake/presets/x64-mingw-static-windows-mingw.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,5 @@
3030
"inherits": "base",
3131
"configurePreset": "x64-mingw-static-windows-mingw"
3232
}
33-
],
34-
"workflowPresets": [
35-
{
36-
"name": "x64-mingw-static-windows-mingw",
37-
"steps": [
38-
{
39-
"type": "configure",
40-
"name": "x64-mingw-static-windows-mingw"
41-
},
42-
{
43-
"type": "build",
44-
"name": "x64-mingw-static-windows-mingw"
45-
},
46-
{
47-
"type": "test",
48-
"name": "x64-mingw-static-windows-mingw"
49-
}
50-
]
51-
}
5233
]
5334
}

cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ function(_vcpkg_checkout vcpkg_root vcpkg_ref)
2323
message(STATUS "vcpkg checkout to ${vcpkg_ref}")
2424

2525
if(EXISTS "${vcpkg_root}/.git/shallow")
26-
message(WARNING "vcpkg is shallow, unshallowing...")
26+
message(
27+
WARNING
28+
"vcpkg is shallow now and unshallow to retrieve the Git tree object hash for a specific version port......"
29+
)
2730
execute_process(
2831
COMMAND ${GIT_EXECUTABLE} fetch --unshallow
2932
WORKING_DIRECTORY ${vcpkg_root}
@@ -78,7 +81,24 @@ function(_vcpkg_tool_bootstrap vcpkg_root)
7881
RESULT_VARIABLE result)
7982

8083
if(NOT result EQUAL "0")
81-
message(FATAL_ERROR "${bootstrap_cmd} failed with ${result}")
84+
if(CMAKE_HOST_UNIX)
85+
message(STATUS "Retry to build vcpkg from source...")
86+
set(bootstrap_impl "${vcpkg_root}/scripts/bootstrap.sh")
87+
file(READ "${bootstrap_impl}" file_contents)
88+
string(REPLACE [[elif [ "$ARCH" = "x86_64" ]; then]]
89+
[[elif [ "$ARCH" = "" ]; then]] file_contents
90+
"${file_contents}")
91+
file(WRITE "${bootstrap_impl}" "${file_contents}")
92+
93+
execute_process(
94+
COMMAND ${bootstrap_cmd} -disableMetrics
95+
WORKING_DIRECTORY ${vcpkg_root}
96+
RESULT_VARIABLE result)
97+
endif()
98+
99+
if(NOT result EQUAL "0")
100+
message(FATAL_ERROR "${bootstrap_cmd} failed with ${result}")
101+
endif()
82102
endif()
83103
endfunction()
84104

@@ -109,7 +129,7 @@ function(_vcpkg_upgrade vcpkg_root vcpkg_repo vcpkg_ref)
109129

110130
message(STATUS "Upgrade vcpkg")
111131
message(STATUS "vcpkg current commit: ${current_git_hash}")
112-
message(STATUS "vcpkg release: ${vcpkg_ref}")
132+
message(STATUS "vcpkg target commit: ${vcpkg_ref}")
113133

114134
execute_process(
115135
COMMAND ${GIT_EXECUTABLE} remote set-url origin ${vcpkg_repo}
@@ -136,9 +156,7 @@ endfunction()
136156

137157
# find root
138158
function(_vcpkg_find_root cache_dir_name out_vcpkg_root)
139-
if(DEFINED ENV{VCPKG_ROOT} AND NOT "$ENV{VCPKG_ROOT}" STREQUAL "")
140-
set(root "$ENV{VCPKG_ROOT}")
141-
elseif("${__vcpkg_bootstrap_host}" STREQUAL "Windows")
159+
if("${__vcpkg_bootstrap_host}" STREQUAL "Windows")
142160
set(root "$ENV{LOCALAPPDATA}/vcpkg/projects/${cache_dir_name}/cache")
143161
else()
144162
set(root "$ENV{HOME}/.cache/vcpkg/projects/${cache_dir_name}")

0 commit comments

Comments
 (0)