Skip to content

Commit

Permalink
Document integration with vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
huangqinjin committed Oct 12, 2024
1 parent 24d1100 commit 313e067
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,26 @@ Other generators are untested and may or may not work. Use it at your own peril.

No. Using Ninja or GNU Make directly should work.

## How to integrate with vcpkg?

You need define your own triplets, e.g. `my-triplets/x64-windows.cmake`:
```cmake
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE $ENV{VCPKG_ROOT}/scripts/toolchains/windows.cmake)
set(ENV{CC} cl.exe)
set(ENV{CXX} cl.exe)
set(ENV{PATH} "/opt/msvc/bin/x64:$ENV{PATH}")
```

Then you can install packages using overlay triplets:
```bash
vcpkg install sqlite3:x64-windows --overlay-triplets=my-triplets
```
See examples [here](test/test-vcpkg.sh).

## I get `ninja: error: build.ninja:225: bad $-escape (literal $ must be written as $$)`

Visual Studio can switch between Debug/Release/RelWithDebInfo/etc at build time in the IDE.
Expand Down

0 comments on commit 313e067

Please sign in to comment.