Skip to content

Commit

Permalink
perf: remove customized items and add the relevant usage instead (#267)
Browse files Browse the repository at this point in the history
Signed-off-by: msclock <msclock@qq.com>
  • Loading branch information
msclock authored May 28, 2024
1 parent ffe0b23 commit b4b511e
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 176 deletions.
2 changes: 2 additions & 0 deletions cmake/vcpkg/bootstrap/vcpkg_chainload_toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ function(_vcpkg_chainload_toolchain)
"Could not find toolchain file for ${_chainload_toolchain_name}, skipping chainload"
)
endif()
message(
STATUS "vcpkg_chainload_toolchain_file: ${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
endfunction()
Empty file removed cmake/vcpkg/ports/.placeholder
Empty file.
3 changes: 3 additions & 0 deletions cmake/vcpkg/ports/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Customize vcpkg ports

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.
3 changes: 3 additions & 0 deletions cmake/vcpkg/scripts/toolchains/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Customize vcpkg toolchains

This folder applies to the custom vcpkg toolchains. These toolchains can be loaded automatically which can be copied from the `scripts/toolchains` folder of the vcpkg repository or created from scratch.
77 changes: 0 additions & 77 deletions cmake/vcpkg/scripts/toolchains/mingw.cmake

This file was deleted.

22 changes: 22 additions & 0 deletions cmake/vcpkg/triplets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Customize vcpkg triplets

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.

For example, to create a custom triplet for Linux x64 with dynamic library linkage:

```bash
# Copy the triplet from the vcpkg repository
cp /path/to/vcpkg/repository/triplets/x64-linux.cmake ./x64-linux.cmake
# Edit the triplet to change the library linkage to dynamic
sed -i ./x64-linux.cmake -e's/set(VCPKG_LIBRARY_LINKAGE static)/set(VCPKG_LIBRARY_LINKAGE dynamic)/g'
# Show the contents of the triplet
cat ./x64-linux.cmake
# set(VCPKG_TARGET_ARCHITECTURE x64)
# set(VCPKG_CRT_LINKAGE dynamic)
# set(VCPKG_LIBRARY_LINKAGE dynamic)

# set(VCPKG_CMAKE_SYSTEM_NAME Linux)

# Use it when configure the project
cmake --preset=default -DVCPKG_TARGET_TRIPLET=x64-linux
```
11 changes: 0 additions & 11 deletions cmake/vcpkg/triplets/x64-mingw-dynamic.cmake

This file was deleted.

10 changes: 10 additions & 0 deletions docs/topics/overlays.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,13 @@ References:

- <https://learn.microsoft.com/en-us/vcpkg/concepts/overlay-ports>
- [Why overlay ports? Install locally modified package](https://learn.microsoft.com/en-us/vcpkg/consume/install-locally-modified-package)

## Overlay of a custom chianload toolchain

> a toolchain file is selected from `scripts/toolchains/` appropriate to the platform by default.
To use a custom chianload toolchain, a directory `cmake/vcpkg/scripts/toolchains` has been created in the root of the scaffold.

References:

- [What is a chianload toolchain in vcpkg?](https://learn.microsoft.com/en-us/vcpkg/users/triplets#vcpkg_chainload_toolchain_file)
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,13 @@ References:

- <https://learn.microsoft.com/en-us/vcpkg/concepts/overlay-ports>
- [Why overlay ports? Install locally modified package](https://learn.microsoft.com/en-us/vcpkg/consume/install-locally-modified-package)

## Overlay of a custom chianload toolchain

> a toolchain file is selected from `scripts/toolchains/` appropriate to the platform by default.
To use a custom chianload toolchain, a directory `cmake/vcpkg/scripts/toolchains` has been created in the root of the scaffold.

References:

- [What is a chianload toolchain in vcpkg?](https://learn.microsoft.com/en-us/vcpkg/users/triplets#vcpkg_chainload_toolchain_file)
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ function(_vcpkg_chainload_toolchain)
"Could not find toolchain file for ${_chainload_toolchain_name}, skipping chainload"
)
endif()
message(
STATUS "vcpkg_chainload_toolchain_file: ${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
endfunction()
Empty file.
3 changes: 3 additions & 0 deletions template/cmake/vcpkg/ports/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Customize vcpkg ports

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.
3 changes: 3 additions & 0 deletions template/cmake/vcpkg/scripts/toolchains/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Customize vcpkg toolchains

This folder applies to the custom vcpkg toolchains. These toolchains can be loaded automatically which can be copied from the `scripts/toolchains` folder of the vcpkg repository or created from scratch.
77 changes: 0 additions & 77 deletions template/cmake/vcpkg/scripts/toolchains/mingw.cmake

This file was deleted.

22 changes: 22 additions & 0 deletions template/cmake/vcpkg/triplets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Customize vcpkg triplets

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.

For example, to create a custom triplet for Linux x64 with dynamic library linkage:

```bash
# Copy the triplet from the vcpkg repository
cp /path/to/vcpkg/repository/triplets/x64-linux.cmake ./x64-linux.cmake
# Edit the triplet to change the library linkage to dynamic
sed -i ./x64-linux.cmake -e's/set(VCPKG_LIBRARY_LINKAGE static)/set(VCPKG_LIBRARY_LINKAGE dynamic)/g'
# Show the contents of the triplet
cat ./x64-linux.cmake
# set(VCPKG_TARGET_ARCHITECTURE x64)
# set(VCPKG_CRT_LINKAGE dynamic)
# set(VCPKG_LIBRARY_LINKAGE dynamic)

# set(VCPKG_CMAKE_SYSTEM_NAME Linux)

# Use it when configure the project
cmake --preset=default -DVCPKG_TARGET_TRIPLET=x64-linux
```
11 changes: 0 additions & 11 deletions template/cmake/vcpkg/triplets/x64-mingw-dynamic.cmake

This file was deleted.

0 comments on commit b4b511e

Please sign in to comment.