Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
Browse files Browse the repository at this point in the history
…jack/add_supports_to_feature
  • Loading branch information
JackBoosY committed Sep 8, 2020
2 parents dccfc53 + bff4dd9 commit 73c346e
Show file tree
Hide file tree
Showing 1,294 changed files with 34,694 additions and 13,316 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
* -text
ports/** -linguist-detectable

# Declare files that will always have LF line endings on checkout.
scripts/ci.baseline.txt text eol=lf
56 changes: 17 additions & 39 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -289,47 +289,25 @@ __pycache__/
/packages/
/scripts/buildsystems/tmp/
/toolsrc/build.rel/
/toolsrc/msbuild.x86.debug/
/toolsrc/msbuild.x86.release/
/toolsrc/msbuild.x64.debug/
/toolsrc/msbuild.x64.release/
/toolsrc/windows-bootstrap/msbuild.x86.debug/
/toolsrc/windows-bootstrap/msbuild.x86.release/
/toolsrc/windows-bootstrap/msbuild.x64.debug/
/toolsrc/windows-bootstrap/msbuild.x64.release/
#ignore custom triplets
/triplets/*
#add vcpkg-designed triplets back in
!triplets/community/arm64-mingw-dynamic.cmake
!triplets/community/arm64-mingw-static.cmake
!triplets/community/arm64-uwp.cmake
!triplets/community/arm64-windows-static.cmake
!triplets/community/arm-mingw-dynamic.cmake
!triplets/community/arm-mingw-static.cmake
!triplets/community/arm-windows.cmake
!triplets/community/x64-mingw-dynamic.cmake
!triplets/community/x64-mingw-static.cmake
!triplets/community/x64-windows-static-md.cmake
!triplets/community/x86-mingw-dynamic.cmake
!triplets/community/x86-mingw-static.cmake
!triplets/community/x86-uwp.cmake
!triplets/community/x86-windows-static.cmake
!triplets/community/x86-windows-static-md.cmake
!triplets/community/x64-osx-dynamic.cmake
!triplets/community/x64-android.cmake
!triplets/community/x86-android.cmake
!triplets/community/arm-android.cmake
!triplets/community/arm64-android.cmake
!triplets/community/arm64-ios.cmake
!triplets/community/arm-ios.cmake
!triplets/community/x64-ios.cmake
!triplets/community/x86-ios.cmake
!triplets/community/wasm32-emscripten.cmake
!triplets/community/arm64-osx.cmake
!triplets/arm-uwp.cmake
!triplets/x64-uwp.cmake
!triplets/x64-windows.cmake
!triplets/x64-windows-static.cmake
!triplets/x86-windows.cmake
!triplets/arm64-windows.cmake
!triplets/x64-linux.cmake
!triplets/x64-osx.cmake
#ignore custom triplets
!/triplets/arm-uwp.cmake
!/triplets/arm64-windows.cmake
!/triplets/x64-linux.cmake
!/triplets/x64-osx.cmake
!/triplets/x64-uwp.cmake
!/triplets/x64-windows-static.cmake
!/triplets/x64-windows.cmake
!/triplets/x86-windows.cmake

!/triplets/community
!/triplets/community/**

*.exe
*.zip

Expand Down
1,622 changes: 1,622 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Vcpkg: Overview

[中文总览](README_zh_CN.md)

Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS.
Expand All @@ -17,7 +18,6 @@ you can run `vcpkg help`, or `vcpkg help [command]` for command-specific help.

[![Build Status](https://dev.azure.com/vcpkg/public/_apis/build/status/microsoft.vcpkg.ci?branchName=master)](https://dev.azure.com/vcpkg/public/_build/latest?definitionId=29&branchName=master)


# Table of Contents

- [Vcpkg: Overview](#vcpkg-overview)
Expand Down Expand Up @@ -254,7 +254,7 @@ and go to the CMake settings (Build, Execution, Deployment > CMake).
Finally, in `CMake options`, add the following line:

```
-DCMAKE_TOOLCHAIN_FILE=C:/Users/nimazzuc/src/vcpkg/scripts/buildsystems/vcpkg.cmake
-DCMAKE_TOOLCHAIN_FILE=[vcpkg root]/scripts/buildsystems/vcpkg.cmake
```

Unfortunately, you'll have to add this to each profile.
Expand Down Expand Up @@ -324,7 +324,7 @@ you may use a simple `vcpkg install --feature-flags=manifests`
For more information, check out the [manifest][getting-started:manifest-spec]
specification.

[getting-started:using-a-package]: docs/examples/intalling-and-using-packages.md
[getting-started:using-a-package]: docs/examples/installing-and-using-packages.md
[getting-started:integration]: docs/users/integration.md
[getting-started:git]: https://git-scm.com/downloads
[getting-started:cmake-tools]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
Expand Down Expand Up @@ -353,7 +353,6 @@ $ ./vcpkg integrate bash

depending on the shell you use, then restart your console.


# Examples

See the [documentation](docs/index.md) for specific walkthroughs,
Expand Down
42 changes: 21 additions & 21 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Vcpkg 总览
# Vcpkg: 总览

[English Overview](README.md)

## 概要
Vcpkg 可帮助您在 Windows、 Linux 和 MacOS 上管理 C 和 C++ 库。
这个工具和生态链正在不断发展,我们一直期待您的贡献!

Expand All @@ -17,8 +18,7 @@ Vcpkg 可帮助您在 Windows、 Linux 和 MacOS 上管理 C 和 C++ 库。

# 目录

- [Vcpkg 总览](#vcpkg-总览)
- [概要](#概要)
- [Vcpkg: 总览](#vcpkg-总览)
- [目录](#目录)
- [入门](#入门)
- [快速开始: Windows](#快速开始-windows)
Expand Down Expand Up @@ -91,14 +91,14 @@ vcpkg团队和贡献者可以看到它的地方,
> .\vcpkg\vcpkg integrate install
```

在此之后, 您可以创建一个非cmake项目 (或打开已有的项目)。
在此之后,您可以创建一个非cmake项目 (或打开已有的项目)。
在您的项目中,所有已安装的库均可立即使用 `#include` 包含您需使用的库的头文件并无需添加额外配置。

若您在 Visual Studio 中使用cmake工程,请查阅[这里](#visual-studio-cmake-工程中使用-vcpkg)

为了在IDE以外在cmake中使用vcpkg, 您需要使用以下工具链文件:
为了在IDE以外在cmake中使用vcpkg,您需要使用以下工具链文件:

```
```cmd
> cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
> cmake --build [build directory]
```
Expand Down Expand Up @@ -140,11 +140,11 @@ $ ./vcpkg/vcpkg install [packages to install]
$ ./vcpkg/vcpkg search [search term]
```

为了在cmake中使用vcpkg, 您需要使用以下工具链文件:
为了在cmake中使用vcpkg,您需要使用以下工具链文件:

```
> cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
> cmake --build [build directory]
```sh
$ cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
$ cmake --build [build directory]
```

在cmake中,您仍需通过 `find_package` 来使用第三方库。
Expand All @@ -158,7 +158,7 @@ $ ./vcpkg/vcpkg search [search term]

在Linux的不同发行版中,您需要安装不同的工具包:

- Debian, Ubuntu, popOS, 或其他基于 Debian 的发行版:
- Debian,Ubuntu,popOS或其他基于 Debian 的发行版:

```sh
$ sudo apt-get update
Expand All @@ -174,7 +174,7 @@ $ scl enable devtoolset-7 bash
```

对于其他的发行版,请确保已安装 g++ 6 或更新的版本。
若您希望添加特定发行版的说明, [请提交一个 PR][contributing:submit-pr]!
若您希望添加特定发行版的说明,[请提交一个 PR][contributing:submit-pr]!

## 安装 macOS Developer Tools

Expand All @@ -192,7 +192,7 @@ $ xcode-select --install
### 在 macOS 10.15 之前版本中安装 GCC

此条只在您的macOS版本低于 10.15 时是必须的。
安装homebrew应当很轻松, 请查阅 <brew.sh> 以获取更多信息。
安装homebrew应当很轻松,请查阅 <brew.sh> 以获取更多信息。
为了更简便,请使用以下命令:

```sh
Expand All @@ -209,7 +209,7 @@ $ brew install gcc

## 在 CMake 中使用 vcpkg

若您希望在CMake中使用vcpkg, 以下内容可能帮助您:
若您希望在CMake中使用vcpkg,以下内容可能帮助您:

### Visual Studio Code 中的 CMake Tools

Expand All @@ -234,15 +234,15 @@ $ brew install gcc
### CLion 中使用 vcpkg

打开 Toolchains 设置
(File > Settings on Windows and Linux CLion > Preferences on macOS),
并打开 CMake 设置 (Build Execution Deployment > CMake)。
(File > Settings on Windows and Linux, CLion > Preferences on macOS),
并打开 CMake 设置 (Build, Execution, Deployment > CMake)。
最后在 `CMake options` 中添加以下行:

```
-DCMAKE_TOOLCHAIN_FILE=C:/Users/nimazzuc/src/vcpkg/scripts/buildsystems/vcpkg.cmake
-DCMAKE_TOOLCHAIN_FILE=[vcpkg root]/scripts/buildsystems/vcpkg.cmake
```

遗憾的是, 您必须手动将此选项加入每个项目配置文件中。
遗憾的是,您必须手动将此选项加入每个项目配置文件中。

### 将 vcpkg 作为一个子模块

Expand Down Expand Up @@ -293,7 +293,7 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/

请查阅 [清单][getting-started:manifest-spec] 获取更多信息。

[getting-started:using-a-package]: docs/examples/intalling-and-using-packages.md
[getting-started:using-a-package]: docs/examples/installing-and-using-packages.md
[getting-started:integration]: docs/users/integration.md
[getting-started:git]: https://git-scm.com/downloads
[getting-started:cmake-tools]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
Expand All @@ -315,7 +315,7 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/


```
```sh
$ ./vcpkg integrate bash
```

Expand Down
8 changes: 4 additions & 4 deletions docs/examples/installing-and-using-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Total elapsed time: 12.04 s
The package sqlite3:x86-windows provides CMake targets:
find_package(sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE sqlite3)
find_package(unofficial-sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3))
```

Expand Down Expand Up @@ -118,11 +118,11 @@ Now let's make a simple CMake project with a main file.
cmake_minimum_required(VERSION 3.0)
project(test)
find_package(sqlite3 CONFIG REQUIRED)
find_package(unofficial-sqlite3 CONFIG REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE sqlite3)
target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)
```
```cpp
// main.cpp
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/overlay-triplets-linux-dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Total elapsed time: 44.82 s
The package sqlite3:x64-linux-dynamic provides CMake targets:
find_package(sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE sqlite3)
find_package(unofficial-sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)
```

Overlay triplets enables your custom triplet files when using `vcpkg install`, `vcpkg update`, `vcpkg upgrade`, and `vcpkg remove`.
Expand Down Expand Up @@ -115,8 +115,8 @@ Total elapsed time: 44.82 s
The package sqlite3:x64-linux provides CMake targets:
find_package(sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE sqlite3)
find_package(unofficial-sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)
```

Note that the default triplet is masked by your custom triplet:
Expand Down
28 changes: 28 additions & 0 deletions docs/maintainers/maintainer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,34 @@ Note that if a library generates CMake integration files (`foo-config.cmake`), r

Finally, DLL files on Windows should never be renamed post-build because it breaks the generated LIBs.

## Code format

### Vcpkg internal code

We require the c/c++ code inside vcpkg to follow the clang-format, if you change them. Please perform the following steps after modification:

- Use Visual Studio:
1. Configure your [clang-format tools](https://devblogs.microsoft.com/cppblog/clangformat-support-in-visual-studio-2017-15-7-preview-1/).
2. Open the modified file.
3. Use shortcut keys Ctrl+K, Ctrl+D to format the current file.

- Use tools:
1. Install [llvm clang-format](https://releases.llvm.org/download.html#10.0.0)
2. Run command:
```cmd
> LLVM_PATH/bin/clang-format.exe -style=file -i changed_file.cpp
```

### Manifest

We require that the manifest file needs to be formatted, perform the following steps to solve this issue:

1. Format all changed manifest files.
```cmd
> vcpkg x-format-manifest --all
```
2. Commit changes to your branch.

## Useful implementation notes

### Portfiles are run in Script Mode
Expand Down
4 changes: 2 additions & 2 deletions docs/maintainers/vcpkg_check_linkage.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This command will either alter the settings for `VCPKG_LIBRARY_LINKAGE` or fail,

## Examples

* [libimobiledevice](https://github.com/Microsoft/vcpkg/blob/master/ports/libimobiledevice/portfile.cmake)
* [abseil](https://github.com/Microsoft/vcpkg/blob/master/ports/abseil/portfile.cmake)

## Source
[scripts/cmake/vcpkg_check_linkage.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_linkage.cmake)
[scripts/cmake/vcpkg_check_linkage.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_linkage.cmake)
2 changes: 2 additions & 0 deletions docs/maintainers/vcpkg_configure_cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ This should be specified unless the port is known to not work under Ninja.
Disables running the CMake configure step in parallel.
This is needed for libraries which write back into their source directory during configure.

This also disables CMAKE_DISABLE_SOURCE_CHANGES.

### NO_CHARSET_FLAG
Disables passing `utf-8` as the default character set to `CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS`.

Expand Down
1 change: 1 addition & 0 deletions docs/maintainers/vcpkg_find_acquire_program.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The current list of programs includes:
- 7Z
- ARIA2 (Downloader)
- BISON
- CLANG
- DARK
- DOXYGEN
- FLEX
Expand Down
Loading

0 comments on commit 73c346e

Please sign in to comment.