How to install a static library version using vpckg manifest files?

Viewed 1104

I'm trying to figure out how to configure my manifest file to compile a static version of my library using vcpkg's new manifest feature. My current manifest file is:

{
  "name": "myProject",
  "version-string": "v0.1",
  ],
  "dependencies": [
    {
      "name": "curl",
      "features" : [
        "openssl"
      ],
      "platform" : "(windows & x64 & static)"
    }
  ]
}

but this results in nothing getting installed. The option "platform" : "windows" installs for the x86-windows triplet, but I can't figure out the correct parameters for x64-windows-static.

I'm also curious -- is there a way to declare a triplet for all libraries, instead of making each library a JSON object and listing it specifically?

1 Answers

As a newly released feature of vcpkg, manifest is actually under development. You could refer to Microsoft Blog about manifest.

Also, an example of the manifest on Github is provided for reference.

The following is an example of an existing port CONTROL file rewritten as a vcpkg.json file:

Source: pango
Version: 1.40.11-6
Homepage: https://ftp.gnome.org/pub/GNOME/sources/pango/
Description: Text and font handling library.
Build-Depends: glib, gettext, cairo, fontconfig, freetype, harfbuzz[glib] (!(windows&static)&!osx)


{
  "name": "pango",
  "version-string": "1.40.11",
  "port-version": 6,
  "homepage": "https://ftp.gnome.org/pub/GNOME/sources/pango/",
  "description": "Text and font handling library.",
  "dependencies": [
    "glib",
    "gettext",
    "cairo",
    "fontconfig",
    "freetype",
    {
      "name": "harfbuzz",
      "features": [ "glib" ],
      "platform": "!(windows & static) & !osx"
    }
  ]
}

Finally, regarding the issue of declaring a triple for all libraries, welcome to submit this issue to Microsoft DC.

Related