Temporarily remove the crt-linkage and library-linkage options

These require a lot more work to integrate properly with vcpkg, reimplement triplet detection and set a custom triplet
main
Duncan Ogilvie 3 years ago
parent 13255c68cf
commit 9a82f8c796

@ -97,16 +97,12 @@ include-after = ["cmake/after-subdir.cmake"]
version = "2021.05.12" version = "2021.05.12"
url = "https://github.com/microsoft/vcpkg/archive/refs/tags/2021.05.12.tar.gz" url = "https://github.com/microsoft/vcpkg/archive/refs/tags/2021.05.12.tar.gz"
packages = ["fmt", "zlib"] packages = ["fmt", "zlib"]
crt-linkage = "dynamic"
library-linkage = "dynamic"
``` ```
The vcpkg `version` will automatically generate the `url` from the [official repository](https://github.com/microsoft/vcpkg/releases). For a custom registry you can specify your own `url` (and omit the `version`). You can browse available packages on [vcpkg.io](https://vcpkg.io/en/packages.html). The vcpkg `version` will automatically generate the `url` from the [official repository](https://github.com/microsoft/vcpkg/releases). For a custom registry you can specify your own `url` (and omit the `version`). You can browse available packages on [vcpkg.io](https://vcpkg.io/en/packages.html).
To specify package features you can use the following syntax: `imgui[docking-experimental,freetype,sdl2-binding,opengl3-binding]`. To specify package features you can use the following syntax: `imgui[docking-experimental,freetype,sdl2-binding,opengl3-binding]`.
The `crt-linkage` specifies the MSVC runtime library variant to use while compiling packages. `library-linkage` is whether libraries built are dynamic (default) or static.
## Packages ## Packages
```toml ```toml

@ -21,8 +21,6 @@ description = "Dependencies from vcpkg"
[vcpkg] [vcpkg]
version = "2021.05.12" version = "2021.05.12"
packages = ["fmt"] packages = ["fmt"]
crt-linkage = "dynamic"
library-linkage = "dynamic"
[find-package] [find-package]
fmt = {} fmt = {}

@ -39,8 +39,6 @@ struct Package {
struct Vcpkg { struct Vcpkg {
std::string version; std::string version;
std::string url; std::string url;
std::string crt_linkage;
std::string library_linkage;
struct Package { struct Package {
std::string name; std::string name;

@ -638,12 +638,6 @@ void generate_cmake(const char *path, const parser::Project *parent_project) {
cmd("FetchContent_GetProperties")("vcpkg"); cmd("FetchContent_GetProperties")("vcpkg");
cmd("if")("NOT", "vcpkg_POPULATED"); cmd("if")("NOT", "vcpkg_POPULATED");
cmd("FetchContent_Populate")("vcpkg"); cmd("FetchContent_Populate")("vcpkg");
if (!project.vcpkg.crt_linkage.empty()) {
cmd("set")("VCPKG_CRT_LINKAGE", project.vcpkg.crt_linkage);
}
if (!project.vcpkg.library_linkage.empty()) {
cmd("set")("VCPKG_LIBRARY_LINKAGE", project.vcpkg.library_linkage);
}
cmd("include")("${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake"); cmd("include")("${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake");
cmd("endif")(); cmd("endif")();
cmd("endif")(); cmd("endif")();

@ -628,18 +628,6 @@ Project::Project(const Project *parent, const std::string &path, bool build) {
v.optional("url", vcpkg.url); v.optional("url", vcpkg.url);
v.optional("version", vcpkg.version); v.optional("version", vcpkg.version);
auto handle_linkage = [&v](const toml::key &ky, std::string &value) {
if (v.contains(ky)) {
v.required(ky, value);
if (value != "dynamic" && value != "static") {
throw std::runtime_error(format_key_error("Unknown linkage, expected dynamic/static", value, v.find(ky)));
}
}
};
handle_linkage("crt-linkage", vcpkg.crt_linkage);
handle_linkage("library-linkage", vcpkg.library_linkage);
for (const auto &p : v.find("packages").as_array()) { for (const auto &p : v.find("packages").as_array()) {
Vcpkg::Package package; Vcpkg::Package package;
const auto &package_str = p.as_string().str; const auto &package_str = p.as_string().str;

@ -9,8 +9,6 @@ description = "Dependencies from vcpkg"
[vcpkg] [vcpkg]
version = "2021.05.12" version = "2021.05.12"
packages = ["fmt"] packages = ["fmt"]
crt-linkage = "dynamic"
library-linkage = "dynamic"
[find-package] [find-package]
fmt = {} fmt = {}

Loading…
Cancel
Save