Skip to content

Commit 32e179d

Browse files
chore(deps): update dependency https://github.com/serious-scaffold/ss-cpp to v1.6.22
1 parent 8a3f8f4 commit 32e179d

11 files changed

+148
-61
lines changed

.copier-answers.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_commit: v1.6.21
1+
_commit: v1.6.22
22
_src_path: https://github.com/serious-scaffold/ss-cpp
33
author_email: [email protected]
44
author_name: l.feng

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ jobs:
628628
run: cmake --build --preset=default --target ccov-all
629629

630630
- name: Upload coverage report
631-
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
631+
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
632632
with:
633633
token: ${{ secrets.CODECOV_TOKEN }}
634634
fail_ci_if_error: true

.github/workflows/renovate.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
RENOVATE_PLATFORM: github
2020
RENOVATE_REPOSITORIES: '["${{ github.repository }}"]'
2121
RENOVATE_REPOSITORY_CACHE: enabled
22-
image: ghcr.io/renovatebot/renovate:39.158.1@sha256:6e67b965456bfa064287d23e1f2009082940e78eb928bafa0820d4f85b14a63d
22+
image: ghcr.io/renovatebot/renovate:39.190.0@sha256:a48e70711ef823e6f0debb8f45cc670018da3a519dc4b787ea77d0aea77a56c6
2323
options: --user root
2424
runs-on: ubuntu-24.04
2525
steps:

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ repos:
9595

9696
# Check for renovate config
9797
- repo: https://github.com/renovatebot/pre-commit-hooks
98-
rev: 39.158.1
98+
rev: 39.185.9
9999
hooks:
100100
- id: renovate-config-validator
101101
stages: [manual]

cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake

+40
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,34 @@ function(_vcpkg_upgrade vcpkg_root vcpkg_repo vcpkg_ref)
111111
return()
112112
endif()
113113

114+
# Check .gitconfig on linux or windows
115+
if(EXISTS "$ENV{HOME}/.gitconfig" OR EXISTS "$ENV{USERPROFILE}/.gitconfig")
116+
execute_process(
117+
COMMAND ${GIT_EXECUTABLE} config --get-all safe.directory
118+
WORKING_DIRECTORY ${vcpkg_root}
119+
OUTPUT_VARIABLE safe_directory
120+
OUTPUT_STRIP_TRAILING_WHITESPACE
121+
RESULT_VARIABLE result)
122+
123+
if(NOT result EQUAL "0")
124+
message(FATAL_ERROR "failed to get git safe directory")
125+
endif()
126+
endif()
127+
128+
if(NOT DEFINED safe_directory
129+
OR (DEFINED safe_directory AND NOT safe_directory MATCHES "${vcpkg_root}"))
130+
message(STATUS "vcpkg root is not in the git safe directory, adding...")
131+
132+
execute_process(
133+
COMMAND ${GIT_EXECUTABLE} config --global safe.directory ${vcpkg_root}
134+
WORKING_DIRECTORY ${vcpkg_root}
135+
RESULT_VARIABLE result)
136+
137+
if(NOT result EQUAL "0")
138+
message(FATAL_ERROR "${GIT_EXECUTABLE} config failed with ${result}")
139+
endif()
140+
endif()
141+
114142
execute_process(
115143
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
116144
WORKING_DIRECTORY ${vcpkg_root}
@@ -210,4 +238,16 @@ function(_vcpkg_bootstrap)
210238
endif()
211239

212240
_vcpkg_set_cache_variables("${vcpkg_root}")
241+
242+
# Make sure downloads folder is 755 on linux
243+
if(CMAKE_HOST_UNIX)
244+
execute_process(
245+
COMMAND chmod 755 ${vcpkg_root}/downloads
246+
WORKING_DIRECTORY ${vcpkg_root}
247+
RESULT_VARIABLE result)
248+
249+
if(NOT result EQUAL "0")
250+
message(STATUS "failed to chmod 755 ${vcpkg_root}/downloads")
251+
endif()
252+
endif()
213253
endfunction()

cmake/vcpkg/bootstrap/vcpkg_chainload_toolchain.cmake

+40-30
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,51 @@ SPDX-FileCopyrightText: Copyright 2024 msclock
55

66
# configure VCPKG_CHAINLOAD_TOOLCHAIN_FILE based on VCPKG_TARGET_TRIPLET and
77
# VCPKG_TARGET_ARCHITECTURE
8-
function(_vcpkg_chainload_toolchain)
9-
if(DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
10-
return()
11-
endif()
8+
macro(_vcpkg_chainload_toolchain)
9+
if(NOT DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
10+
if(NOT DEFINED VCPKG_TARGET_TRIPLET OR NOT DEFINED
11+
VCPKG_TARGET_ARCHITECTURE)
12+
message(
13+
FATAL_ERROR
14+
"VCPKG_TARGET_TRIPLET and VCPKG_TARGET_ARCHITECTURE must be set before calling _vcpkg_chainload_toolchain()"
15+
)
16+
endif()
1217

13-
if(NOT DEFINED VCPKG_TARGET_TRIPLET OR NOT DEFINED VCPKG_TARGET_ARCHITECTURE)
14-
message(
15-
FATAL_ERROR
16-
"VCPKG_TARGET_TRIPLET and VCPKG_TARGET_ARCHITECTURE must be set before calling _vcpkg_chainload_toolchain()"
17-
)
18-
endif()
18+
# Load toolchain variables from triplet and architecture
19+
20+
string(LENGTH "${VCPKG_TARGET_ARCHITECTURE}-" _prefix_len)
21+
string(SUBSTRING ${VCPKG_TARGET_TRIPLET} ${_prefix_len} -1 _stripped_string)
22+
string(REPLACE "-" ";" _triplet_parts "${_stripped_string}")
23+
list(GET _triplet_parts 0 _chainload_toolchain_name)
1924

20-
# Load toolchain variables from triplet and architecture
25+
set(_toolchain "scripts/toolchains/${_chainload_toolchain_name}.cmake")
2126

22-
string(LENGTH "${VCPKG_TARGET_ARCHITECTURE}-" _prefix_len)
23-
string(SUBSTRING ${VCPKG_TARGET_TRIPLET} ${_prefix_len} -1 _stripped_string)
24-
string(REPLACE "-" ";" _triplet_parts "${_stripped_string}")
25-
list(GET _triplet_parts 0 _chainload_toolchain_name)
27+
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${_toolchain}")
28+
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE
29+
"${CMAKE_CURRENT_LIST_DIR}/${_toolchain}"
30+
CACHE INTERNAL "vcpkg chainload")
31+
elseif(EXISTS "${_VCPKG_ROOT}/${_toolchain}")
32+
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE
33+
"${_VCPKG_ROOT}/${_toolchain}"
34+
CACHE INTERNAL "vcpkg chainload")
2635

27-
set(_toolchain "scripts/toolchains/${_chainload_toolchain_name}.cmake")
36+
else()
37+
message(
38+
WARNING
39+
"Could not find toolchain file for ${_chainload_toolchain_name}, skipping chainload"
40+
)
41+
endif()
42+
endif()
2843

29-
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${_toolchain}")
30-
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE
31-
"${CMAKE_CURRENT_LIST_DIR}/${_toolchain}"
32-
CACHE INTERNAL "vcpkg chainload")
33-
elseif(EXISTS "${_VCPKG_ROOT}/${_toolchain}")
34-
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE
35-
"${_VCPKG_ROOT}/${_toolchain}"
36-
CACHE INTERNAL "vcpkg chainload")
37-
else()
44+
if(EXISTS "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
3845
message(
39-
WARNING
40-
"Could not find toolchain file for ${_chainload_toolchain_name}, skipping chainload"
46+
STATUS "vcpkg_chainload_toolchain_file: ${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}"
4147
)
48+
include(${VCPKG_CHAINLOAD_TOOLCHAIN_FILE})
4249
endif()
43-
message(
44-
STATUS "vcpkg_chainload_toolchain_file: ${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
45-
endfunction()
50+
unset(_chainload_toolchain_name)
51+
unset(_triplet_parts)
52+
unset(_toolchain)
53+
unset(_prefix_len)
54+
unset(_stripped_string)
55+
endmacro()

cmake/vcpkg/ports/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
# Customize vcpkg ports
22

33
This folder applies to the custom vcpkg ports. These ports are loaded automatically which can be patched from the `ports` folder of the vcpkg repository or created from scratch.
4+
5+
## Customize linkage
6+
7+
Prepare the port from the vcpkg repository
8+
9+
```bash
10+
cp /path/to/vcpkg/repository/ports/7zip . -r
11+
```
12+
13+
Edit the port to only accept the dynamic linkage by [vcpkg_check_linkage](https://learn.microsoft.com/en-us/vcpkg/maintainers/functions/vcpkg_check_linkage) to the head of the port file
14+
15+
```bash
16+
sed -i '1s/^/vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)\n/' 7zip/portfile.cmake
17+
```
18+
19+
And re-cmake the project to re-build the port with dynamic linkage.

cmake/vcpkg/scripts/build_type.cmake

+23-15
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,30 @@ SPDX-FileCopyrightText: Copyright 2024 msclock
55
This module initializes the build type.
66
]]
77

8-
if(NOT CMAKE_BUILD_TYPE)
9-
message(STATUS "Setting CMAKE_BUILD_TYPE to 'Debug' as none was specified.")
10-
endif()
11-
set(CMAKE_BUILD_TYPE
12-
Debug
13-
CACHE STRING "Choose the type of build.")
14-
15-
# Set the possible values of build type for cmake-gui, ccmake
16-
get_property(_builtin_build_types GLOBAL PROPERTY CMAKE_BUILD_TYPE)
8+
get_property(_is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
179

18-
foreach(_type "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
19-
if(NOT _type IN_LIST _builtin_build_types)
20-
list(APPEND _builtin_build_types ${_type})
10+
if(_is_multi_config)
11+
message(STATUS "Multi-config generator detected")
12+
message(STATUS "Available configuration types: ${CMAKE_CONFIGURATION_TYPES}")
13+
else()
14+
message(STATUS "Single-config generator detected")
15+
if(NOT CMAKE_BUILD_TYPE)
16+
message(STATUS "Setting CMAKE_BUILD_TYPE to 'Debug' as none was specified.")
17+
set(CMAKE_BUILD_TYPE
18+
Debug
19+
CACHE STRING "Choose the type of build.")
2120
endif()
22-
endforeach()
2321

24-
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${_builtin_build_types})
22+
# Set the possible values of build type for cmake-gui, ccmake
23+
get_property(_builtin_build_types GLOBAL PROPERTY CMAKE_BUILD_TYPE)
24+
25+
foreach(_type "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
26+
if(NOT _type IN_LIST _builtin_build_types)
27+
list(APPEND _builtin_build_types ${_type})
28+
endif()
29+
endforeach()
2530

26-
unset(_builtin_build_types)
31+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${_builtin_build_types})
32+
33+
unset(_builtin_build_types)
34+
endif()

cmake/vcpkg/triplets/README.md

+20-10
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,31 @@
22

33
This folder applies to the custom vcpkg triplets. These triplets are loaded automatically which can be copied from the `triplets` folder of the vcpkg repository or created from scratch.
44

5-
For example, to create a custom triplet for Linux x64 with dynamic library linkage:
5+
## Customize linkage
6+
7+
Prepare the triplet from the vcpkg repository
68

79
```bash
8-
# Copy the triplet from the vcpkg repository
910
cp /path/to/vcpkg/repository/triplets/x64-linux.cmake ./x64-linux.cmake
10-
# Edit the triplet to change the library linkage to dynamic
11+
```
12+
13+
Edit the triplet to change the [VCPKG_LIBRARY_LINKAGE](https://learn.microsoft.com/en-us/vcpkg/users/triplets) to dynamic
14+
15+
```bash
16+
# Apply for all ports to link dynamically
1117
sed -i ./x64-linux.cmake -e's/set(VCPKG_LIBRARY_LINKAGE static)/set(VCPKG_LIBRARY_LINKAGE dynamic)/g'
12-
# Show the contents of the triplet
13-
cat ./x64-linux.cmake
14-
# set(VCPKG_TARGET_ARCHITECTURE x64)
15-
# set(VCPKG_CRT_LINKAGE dynamic)
16-
# set(VCPKG_LIBRARY_LINKAGE dynamic)
1718

18-
# set(VCPKG_CMAKE_SYSTEM_NAME Linux)
19+
# Or apply for specific ports to link dynamically
20+
cat << EOF >> ./x64-linux.cmake
21+
if(PORT MATCHES "qt5-")
22+
set(VCPKG_LIBRARY_LINKAGE dynamic)
23+
endif()
24+
EOF
25+
```
26+
27+
Use it when configure the project
1928

29+
```bash
2030
# Use it when configure the project
21-
cmake --preset=default -DVCPKG_TARGET_TRIPLET=x64-linux
31+
cmake ... -DVCPKG_TARGET_TRIPLET=x64-linux
2232
```

cmake/vcpkg/vcpkg.toolchain.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ set(VCPKG_VERBOSE
2828
file(READ ${CMAKE_SOURCE_DIR}/vcpkg.json _vcpkg_json)
2929
string(JSON _builtin_baseline GET ${_vcpkg_json} builtin-baseline)
3030
vcpkg_configure(CACHE_DIR_NAME cppfront-practice REF ${_builtin_baseline})
31+
32+
message(STATUS "CMAKE_CXX_COMPILER_TARGET: ${CMAKE_CXX_COMPILER_TARGET}")
33+
message(STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")

vcpkg.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
33
"name": "cppfront-practice",
44
"description": "Practice based on cppfront",
5-
"builtin-baseline": "efb1e7436979a30c4d3e5ab2375fd8e2e461d541",
5+
"builtin-baseline": "cd1099f42a3c2ee28dc68e3db3f6f88658982736",
66
"homepage": "https://github.com/msclock/cppfront-practice",
77
"dependencies": [
88
"cppfront",
@@ -45,7 +45,7 @@
4545
"registries": [
4646
{
4747
"kind": "git",
48-
"baseline": "1d0d4631798175f9863f730609711bd695154600",
48+
"baseline": "82147f387552e0f31d5ca2c9370d9726789fa568",
4949
"repository": "https://github.com/msclock/cmake-registry",
5050
"packages": [
5151
"cmake-modules",

0 commit comments

Comments
 (0)