7

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?

nathan lachenmyer
  • 5,298
  • 8
  • 36
  • 57

2 Answers2

1

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.

Barrnet Chou
  • 1,738
  • 1
  • 4
  • 7
0

You've misunderstood the manifest mode.

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

The code above means you'll only need the lib when triplet x64-windows-static is used.

What you have to do is to specify the right triplet when configure your project.

For example for CMake projects. set variable VCPKG_TARGET_TRIPLET to x64-windows-static before the first project() directive:

set(VCPKG_TARGET_TRIPLET x64-windows-static)
project ("myProject")

For more information, consult buildsystems.

Atliac
  • 1
  • 1