Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] Environment Variable Passthrough #7290

Merged
merged 5 commits into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/get_triplet_environment.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ message("VCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}")
message("VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH}")
message("VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
message("VCPKG_BUILD_TYPE=${VCPKG_BUILD_TYPE}")
message("VCPKG_ENV_PASSTHROUGH=${VCPKG_ENV_PASSTHROUGH}")
24 changes: 24 additions & 0 deletions toolsrc/include/vcpkg/build.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,29 @@ namespace vcpkg::Build
std::string create_error_message(const BuildResult build_result, const PackageSpec& spec);
std::string create_user_troubleshooting_message(const PackageSpec& spec);

enum class VcpkgTripletVar
{
TARGET_ARCHITECTURE = 0,
CMAKE_SYSTEM_NAME,
CMAKE_SYSTEM_VERSION,
PLATFORM_TOOLSET,
VISUAL_STUDIO_PATH,
CHAINLOAD_TOOLCHAIN_FILE,
BUILD_TYPE,
ENV_PASSTHROUGH,
};

const std::unordered_map<std::string, VcpkgTripletVar> VCPKG_OPTIONS = {
{"VCPKG_TARGET_ARCHITECTURE", VcpkgTripletVar::TARGET_ARCHITECTURE},
{"VCPKG_CMAKE_SYSTEM_NAME", VcpkgTripletVar::CMAKE_SYSTEM_NAME},
{"VCPKG_CMAKE_SYSTEM_VERSION", VcpkgTripletVar::CMAKE_SYSTEM_VERSION},
{"VCPKG_PLATFORM_TOOLSET", VcpkgTripletVar::PLATFORM_TOOLSET},
{"VCPKG_VISUAL_STUDIO_PATH", VcpkgTripletVar::VISUAL_STUDIO_PATH},
{"VCPKG_CHAINLOAD_TOOLCHAIN_FILE", VcpkgTripletVar::CHAINLOAD_TOOLCHAIN_FILE},
{"VCPKG_BUILD_TYPE", VcpkgTripletVar::BUILD_TYPE},
{"VCPKG_ENV_PASSTHROUGH", VcpkgTripletVar::ENV_PASSTHROUGH},
};

/// <summary>
/// Settings from the triplet file which impact the build environment and post-build checks
/// </summary>
Expand All @@ -135,6 +158,7 @@ namespace vcpkg::Build
Optional<fs::path> visual_studio_path;
Optional<std::string> external_toolchain_file;
Optional<ConfigurationType> build_type;
std::vector<std::string> passthrough_env_vars;
};

std::string make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset);
Expand Down
2 changes: 2 additions & 0 deletions toolsrc/include/vcpkg/sourceparagraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ namespace vcpkg

std::vector<std::string> filter_dependencies(const std::vector<Dependency>& deps, const Triplet& t);
std::vector<FeatureSpec> filter_dependencies_to_specs(const std::vector<Dependency>& deps, const Triplet& t);
std::vector<Features> filter_dependencies_to_features(const std::vector<vcpkg::Dependency>& deps,
const Triplet& t);

// zlib[uwp] becomes Dependency{"zlib", "uwp"}
std::vector<Dependency> expand_qualified_dependencies(const std::vector<std::string>& depends);
Expand Down
Loading