diff options
| author | LiGuilin <liguilin0522@qq.com> | 2016-10-08 08:34:12 +0800 |
|---|---|---|
| committer | LiGuilin <liguilin0522@qq.com> | 2016-10-08 08:34:12 +0800 |
| commit | c91da2b0c4c3d9218c0b4d1712d744bb35245a61 (patch) | |
| tree | e1ae0664a4f21f3948bde8c8f9f9e55dea0cb11f /docs | |
| parent | 280d88b34033ab728e02f725d8d8ff5f9250c6de (diff) | |
| parent | a0f621c0fca2c3de8bd5249f023979b800c543cf (diff) | |
| download | vcpkg-c91da2b0c4c3d9218c0b4d1712d744bb35245a61.tar.gz vcpkg-c91da2b0c4c3d9218c0b4d1712d744bb35245a61.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/EXAMPLES.md | 1 | ||||
| -rw-r--r-- | docs/FAQ.md | 22 | ||||
| -rw-r--r-- | docs/example-3-patch-libpng.md (renamed from docs/EXAMPLE_fix_libpng.md) | 27 |
3 files changed, 26 insertions, 24 deletions
diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index 3415dc754..d991d87f9 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -14,6 +14,7 @@ For short description of available commands, run `vcpkg help`. - <a href="#example-1-2-c">Option C: Other buildsystems</a> - <a href="#example-1-2-d">Option D: VS Project (Individual Project integration)</a> - <a href="#example-2">Example 2: Package a remote project (zlib)</a> +- <a href="example-3-patch-libpng.md">Example 3: Patching libpng to work for uwp-x86</a> <a name="example-1"></a> ## Example 1: C++ REST SDK diff --git a/docs/FAQ.md b/docs/FAQ.md index aff30468b..15608ae74 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -10,22 +10,27 @@ In the preview release, we do not have a supported way to distribute individual We instead recommend copying the entire system as a whole (which ensures that every package and its dependencies stay in sync with each other). -## How will the libs will be updated locally? +## How do I update libraries? The `vcpkg update` command lists all packages which are out-of-sync with your current portfiles. To update a package, follow the instructions in the command. +## How do I get more libraries? +The list of libraries is enumerated from the [`ports\`](../ports) directory. By design, you can add and remove libraries from this directory as you see fit for yourself or your company (see [Example #2](EXAMPLES.md#example-2)). + +We recommend cloning directly from [GitHub](https://github.com/microsoft/vcpkg) and using `git pull` to update the list of portfiles. Once you've updated your portfiles, `vcpkg update` will indicate any installed libraries that are now out of date. + ## Can I build a private library with this tool? Yes. Follow [Example #2](EXAMPLES.md#example-2) for creating a portfile using a fake URL. Then, either pre-seed the `downloads\` folder with a zip containing your private sources or replace the normal `vcpkg_download_distfile` and `vcpkg_extract_source_archive` with functions that unpack your source code. ## Can I use a prebuilt private library with this tool? Yes. The `portfile.cmake` for a library is fundamentally a script that places the headers and binaries into the correct arrangement in the `${CURRENT_PACKAGES_DIR}`, so to pull in prebuilt binaries you can write a portfile which directly downloads and arranges the files. -To see an example of this, look at the [`opengl`](../ports/opengl/portfile.cmake) package which simply copies files out of the Windows SDK. +To see an example of this, look at [`ports\opengl\portfile.cmake`](../ports/opengl/portfile.cmake) package which simply copies files out of the Windows SDK. ## Which platforms I can target with Vcpkg? We currently target Windows Desktop (x86 and x64) as well as the Universal Windows Platform (x86, x64, and ARM). See `vcpkg help triplet` for the current list. ## Does `vcpkg.exe` run on Linux/OSX? -No, for this preview we are focusing on Windows as a host platform. If you'd be interested in having Vcpkg run on Linux or OSX, please let us know in an [issue](https://github.com/microsoft/vcpkg/issues). +No, for this preview we are focusing on Windows as a host platform. If you'd be interested in having Vcpkg run on Linux or OSX, please let us know in [this issue](https://github.com/microsoft/vcpkg/issues/57). ## How do I use different versions of a library on one machine? Within a single instance of Vcpkg (e.g. one set of `installed\`, `packages\`, `ports\` and so forth), you can only have one version of a library installed (otherwise, the headers would conflict with each other!). This is because a package in Vcpkg corresponds to the `X-dev` or `X-devel` packages in other system package managers. @@ -48,13 +53,8 @@ By saving the changes to the portfile (and checking them in), you'll get the sam ## How is CMake used internally by Vcpkg? Vcpkg uses CMake internally as a build scripting language. This is because CMake is already an extremely common build system for cross-platform open source libraries and is becoming very popular for C++ projects in general. It is easy to acquire on Windows (does not require system-wide installation) and reasonably legible for unfamiliar users. -## How does my list of libraries get updated? -The list of libraries is enumerated from the `ports\` directory. By design, you can add and remove libraries from this directory as you see fit for yourself or your company (see [Example #2](EXAMPLES.md#example-2)). - -We recommend cloning directly from [GitHub](https://github.com/microsoft/vcpkg) and using `git pull` to update the list of portfiles. Once you've updated your portfiles, `vcpkg update` will indicate any installed libraries that are now out of date. - -## Will it support also downloading compiled binaries from a public or private server? -We do plan to eventually support downloading precompiled binaries, similar to other systems package managers. +## Will Vcpkg support downloading compiled binaries from a public or private server? +We do plan to eventually support downloading precompiled binaries, similar to other system package managers. In a corporate scenario, we currently recommend building the libraries once and distributing the entire vcpkg root directory to everyone else on the project through some raw file transport such as a network share or HTTP host. @@ -64,7 +64,7 @@ We plan to only support Visual Studio 2015 and above. ## Can I acquire my package's sources by Git url+tag? Yes, however we prefer compressed archives of the specific release/commit since the internal downloads and build trees are meant to be read only. Github provides archives for every commit, tag, and branch, so it's always possible to perform this substitution for repositories hosted there. -See `ports\cpprestsdk\portfile.cmake` and `ports\opencv\portfile.cmake` for examples of using git directly. +See [`ports\cpprestsdk\portfile.cmake`](../ports/cpprestsdk/portfile.cmake) for an example of using git directly. ## Why not NuGet? NuGet is a package manager for .NET libraries with a strong dependency on MSBuild. It does not meet the specific needs of Native C++ customers in at least three ways. diff --git a/docs/EXAMPLE_fix_libpng.md b/docs/example-3-patch-libpng.md index 535927c16..cc963cbfc 100644 --- a/docs/EXAMPLE_fix_libpng.md +++ b/docs/example-3-patch-libpng.md @@ -1,6 +1,6 @@ -Fixing libpng:x86-uwp -===================== +## Example 3: Patching libpng to work for uwp-x86 +### Initial error logs First, try building: ``` @@ -59,6 +59,9 @@ Next, looking at the above logs (build-...-out.log and build-...-err.log). Time Elapsed 00:00:04.19 ``` + +### Identify the problematic code + Taking a look at [MSDN](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx) shows that `ExitProcess` is only available for desktop apps. Additionally, it's useful to see the surrounding context: ```c @@ -107,7 +110,9 @@ This already gives us some great clues, but the full definition tells the comple #endif ``` -`abort()` is a standard CRT call and certainly available in UWP, so we just need to convince libpng to be more platform agnostic. The easiest and most reliable way to achive is to patch the code; while in this particular case we could pass in a compiler flag to override `PNG_ABORT` because this is a private header, in general it is more reliable to avoid adding more required compiler switches when possible (especially when it isn't already exposed as a CMake option). +`abort()` is a standard CRT call and certainly available in UWP, so we just need to convince libpng to be more platform agnostic. The easiest and most reliable way to achieve this is to patch the code; while in this particular case we could pass in a compiler flag to override `PNG_ABORT` because this is a private header, in general it is more reliable to avoid adding more required compiler switches when possible (especially when it isn't already exposed as a CMake option). + +### Patching the code to improve compatibility I recommend using git to create the patch file, since you'll already have it installed. ``` @@ -144,22 +149,18 @@ Finally, we need to apply the patch after extracting the source. ... vcpkg_extract_source_archive(${ARCHIVE}) -find_program(GIT git) -vcpkg_execute_required_process( - COMMAND ${GIT} init - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24 - LOGNAME git-init -) -execute_process( - COMMAND ${GIT} apply "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" --ignore-whitespace --whitespace=nowarn - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24 +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24 + PATCHES "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" ) vcpkg_configure_cmake( ... ``` -To be completely sure this works from the top, we need to purge the package: +### Verification + +To be completely sure this works from scratch, we need to purge the package: ``` PS D:\src\vcpkg> vcpkg remove --purge libpng:x86-uwp |
