Skip to content
Draft
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
24db2f7
WIP parse trace output
Neumann-A Nov 8, 2022
f30615c
json parser complete
Neumann-A Nov 8, 2022
75f3345
WIP; next todo: loop over call blocks.
Neumann-A Nov 9, 2022
8eeb0f1
fill lookup table
Neumann-A Nov 9, 2022
73a2c24
prepare for abi tag generation
Neumann-A Nov 9, 2022
cc6e7d9
fix build error after lookup table change
Neumann-A Nov 9, 2022
0fcc43b
fix build
Neumann-A Nov 9, 2022
1ac7513
create abi entries.
Neumann-A Nov 9, 2022
45a816d
rip out triplet hashing, rename triplet_abi -> toolchain_abi
Neumann-A Nov 9, 2022
bb72c57
rename variable to make ci happy
Neumann-A Nov 9, 2022
566780d
bit of cleanup
Neumann-A Nov 9, 2022
7c42d7a
fix vcpkg-test
Neumann-A Nov 9, 2022
8a4621c
leave comment about x-cmake-args
Neumann-A Nov 9, 2022
b4be9a3
flatten vector to simple string; WIP: record other variable changing …
Neumann-A Nov 9, 2022
71a602f
formating
Neumann-A Nov 9, 2022
6a6262d
move line endings
Neumann-A Nov 10, 2022
58110cf
apply format
Neumann-A Nov 10, 2022
e538902
add numeric include
Neumann-A Nov 10, 2022
22e2fa5
Merge remote-tracking branch 'upstream/main' into hash_variables_usin…
Neumann-A Nov 11, 2022
2514ee2
need some newlines for linux so that trace output info doesn't break …
Neumann-A Nov 11, 2022
34b0166
set load_vcvars_env to false for !windows
Neumann-A Nov 11, 2022
3a2426d
apply format
Neumann-A Nov 11, 2022
124f694
fix e2e test
Neumann-A Nov 11, 2022
73fd28d
rename define to use _WIN32 as the rest of the code
Neumann-A Nov 12, 2022
20b1826
more cases and bug fixes
Neumann-A Nov 12, 2022
aec5d21
e2e test
Neumann-A Nov 12, 2022
06c3a1c
apply diff
Neumann-A Nov 12, 2022
0d554f5
fix test
Neumann-A Nov 12, 2022
0f6c70d
set VCPKG_CMAKE_SYSTEM_NAME for e2e test on platforms !windows
Neumann-A Nov 12, 2022
5aeafa6
fix osx triplet
Neumann-A Nov 13, 2022
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 azure-pipelines/e2e_ports/triplet-abi/file-to-read
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nothing to see here
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
ENV{NOTPATH} unset(ENV{NOTPATH})
EXE_ERR_VAR execute_process(COMMAND;echo;Hello;OUTPUT_VARIABLE;EXE_OUT_VAR;RESULT_VARIABLE;EXE_RES_VAR;ERROR_VARIABLE;EXE_ERR_VAR)
EXE_OUT_VAR execute_process(COMMAND;echo;Hello;OUTPUT_VARIABLE;EXE_OUT_VAR;RESULT_VARIABLE;EXE_RES_VAR;ERROR_VARIABLE;EXE_ERR_VAR)
EXE_RES_VAR execute_process(COMMAND;echo;Hello;OUTPUT_VARIABLE;EXE_OUT_VAR;RESULT_VARIABLE;EXE_RES_VAR;ERROR_VARIABLE;EXE_ERR_VAR)
FILE_CMAKE_VAR file(TO_CMAKE_PATH;${CMAKE_CURRENT_LIST_DIR}/file-to-read;FILE_CMAKE_VAR)
FILE_GLOB_VAR file(GLOB;FILE_GLOB_VAR;*)
FILE_HASH_VAR file(SHA512;${CMAKE_CURRENT_LIST_DIR}/file-to-read;FILE_HASH_VAR)
FILE_READ_VAR file(READ;${CMAKE_CURRENT_LIST_DIR}/file-to-read;FILE_READ_VAR)
FILE_REAL_VAR file(REAL_PATH;${CMAKE_CURRENT_LIST_DIR}/file-to-read;FILE_REAL_VAR)
FILE_REL_VAR file(RELATIVE_PATH;FILE_REL_VAR;${CMAKE_CURRENT_LIST_DIR};${CMAKE_CURRENT_LIST_DIR}/file-to-read)
FILE_SIZE_VAR file(SIZE;${CMAKE_CURRENT_LIST_DIR}/file-to-read;FILE_SIZE_VAR)
FILE_STRINGS_VAR file(STRINGS;${CMAKE_CURRENT_LIST_DIR}/file-to-read;FILE_STRINGS_VAR)
FILE_TIMESTAMP_VAR file(TIMESTAMP;${CMAKE_CURRENT_LIST_DIR}/file-to-read;FILE_TIMESTAMP_VAR)
FIND_VAR find_program(FIND_VAR;NAMES;gcc)
GET_VAR get_directory_property(GET_VAR;VARIABLES)
JSON_ERR_VAR string(JSON;JSON_VAR;ERROR_VARIABLE;JSON_ERR_VAR;GET;{\"test\": true};test)
JSON_VAR string(JSON;JSON_VAR;ERROR_VARIABLE;JSON_ERR_VAR;GET;{\"test\": true};test)
LIST_OUT_VAR list(POP_BACK;LIST_VAR;LIST_OUT_VAR)
LIST_VAR list(POP_BACK;LIST_VAR;LIST_OUT_VAR)
LIST_VAR2 list(APPEND;LIST_VAR2;e1;e2;e3)
MATH_VAR math(EXPR;MATH_VAR;1 + 1)
OPT_VAR option(OPT_VAR;TEXT;OFF)
PATH_CONVERT_VAR cmake_path(CONVERT;$ENV{PATH};TO_CMAKE_PATH_LIST;PATH_CONVERT_VAR)
PATH_HASH_VAR cmake_path(HASH;PATH_VAR;PATH_HASH_VAR)
PATH_HAS_VAR cmake_path(HAS_EXTENSION;PATH_VAR;PATH_HAS_VAR)
PATH_IS_VAR cmake_path(IS_RELATIVE;PATH_VAR;PATH_IS_VAR)
PATH_NATIVE_VAR cmake_path(NATIVE_PATH;PATH_VAR;PATH_NATIVE_VAR)
PATH_NORMAL_VAR cmake_path(NORMAL_PATH;PATH_VAR;OUTPUT_VARIABLE;PATH_NORMAL_VAR)
PATH_REMOVE_VAR cmake_path(REMOVE_FILENAME;PATH_VAR;OUTPUT_VARIABLE;PATH_REMOVE_VAR)
PATH_ROOT_VAR cmake_path(GET;PATH_VAR;ROOT_NAME;PATH_ROOT_VAR)
PATH_VAR cmake_path(SET;PATH_VAR;i/am/a/path)
SEPT_VAR separate_arguments(SEPT_VAR;NATIVE_COMMAND;-sep -args -please)
SITE_VAR site_name(SITE_VAR)
STRING_APPEND_VAR string(APPEND;STRING_APPEND_VAR;APPENDME)
STRING_ASCII_VAR string(ASCII;10;20;30;STRING_ASCII_VAR)
STRING_COMPARE_VAR string(COMPARE;EQUAL;ABC;123;STRING_COMPARE_VAR)
STRING_CONCAT_VAR string(CONCAT;STRING_CONCAT_VAR;abc;123)
STRING_C_VAR string(MAKE_C_IDENTIFIER;0x100;STRING_C_VAR)
STRING_FIND_VAR string(FIND;FINDME;ME;STRING_FIND_VAR)
STRING_HASH_VAR string(SHA512;STRING_HASH_VAR;12345)
STRING_HEX_VAR string(HEX;1020;STRING_HEX_VAR)
STRING_PREPEND_VAR string(PREPEND;STRING_PREPEND_VAR;PREPENDME)
STRING_RANDOM_VAR string(RANDOM;STRING_RANDOM_VAR)
STRING_REG_MATCH_VAR string(REGEX;MATCH;TEST;STRING_REG_MATCH_VAR;TEST123)
STRING_REG_REPLACE_VAR string(REGEX;REPLACE;TEST;;STRING_REG_REPLACE_VAR;TEST123)
STRING_REPEAT_VAR string(REPEAT;REPEAT;2;STRING_REPEAT_VAR)
STRING_REPLACE_VAR string(REPLACE;ME;;STRING_REPLACE_VAR;ALLABOUTMEME)
STRING_SUB_VAR string(SUBSTRING;ABCDEF;0;3;STRING_SUB_VAR)
STRING_TIME_VAR string(TIMESTAMP;STRING_TIME_VAR)
STRING_UUID_VAR string(UUID;STRING_UUID_VAR;NAMESPACE;6ba7b810-9dad-11d1-80b4-00c04fd430c8;NAME;test;TYPE;SHA1)
VCPKG_CRT_LINKAGE set(VCPKG_CRT_LINKAGE;dynamic)
VCPKG_LIBRARY_LINKAGE set(VCPKG_LIBRARY_LINKAGE;static)
VCPKG_TARGET_ARCHITECTURE set(VCPKG_TARGET_ARCHITECTURE;x64)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

file(STRINGS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}.vcpkg_abi_info.txt" actual_abi_lines)
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/expected-abi.txt" expected_abi_lines)
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/unexpected-abi.txt" unexpected_abi_lines)

foreach(expected_line IN LISTS expected_abi_lines)
if(NOT "${expected_line}" IN_LIST actual_abi_lines)
message(FATAL_ERROR "Expected ABI: '${expected_line}' \n not within actual ABI: '${actual_abi_lines}'")
endif()
endforeach()

foreach(unexpected_abi_line IN LISTS unexpected_abi_lines)
if("${unexpected_abi_line}" IN_LIST actual_abi_lines)
message(FATAL_ERROR "Unexpected ABI: '${expected_line}' \n found within actual ABI: '${actual_abi_lines}'")
endif()
endforeach()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NOT_IN_ABI_UNSET set(NOT_IN_ABI_UNSET;test)
NOT_IN_ABI_UNSET unset(NOT_IN_ABI_UNSET)
NOT_IN_ABI_UNSET_2 unset(NOT_IN_ABI_UNSET_2)
NOT_IN_ABI set(NOT_IN_ABI;TEST)
NOT IN ABI COMMENT
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "vcpkg-test-triplet-abi",
"version": "0",
"description": "A port that inspects the abi"
}
Comment thread
Neumann-A marked this conversation as resolved.
64 changes: 64 additions & 0 deletions azure-pipelines/e2e_ports/triplet-abi/x64-abi.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
set(VCPKG_TARGET_ARCHITECTURE x64) #
set(VCPKG_CRT_LINKAGE dynamic) #
set(VCPKG_LIBRARY_LINKAGE static) #
if(0)
set(VCPKG_CMAKE_SYSTEM_NAME Windows) # NOT IN ABI COMMENT
elseif(DARWIN)
Comment thread
Neumann-A marked this conversation as resolved.
Outdated
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
elseif(UNIX)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
endif()
set(NOT_IN_ABI_UNSET "test")
unset(NOT_IN_ABI_UNSET)
unset(NOT_IN_ABI_UNSET_2)
unset(ENV{NOTPATH}) #
option(OPT_VAR "TEXT" OFF) #
separate_arguments(SEPT_VAR NATIVE_COMMAND "-sep -args -please") #
site_name(SITE_VAR) #
get_directory_property(GET_VAR VARIABLES) #
find_program(FIND_VAR NAMES gcc) #
cmake_path(SET PATH_VAR "i/am/a/path") #
cmake_path(GET PATH_VAR ROOT_NAME PATH_ROOT_VAR) #
cmake_path(HASH PATH_VAR PATH_HASH_VAR) #
cmake_path(NATIVE_PATH PATH_VAR PATH_NATIVE_VAR) #
cmake_path(IS_RELATIVE PATH_VAR PATH_IS_VAR) #
cmake_path(HAS_EXTENSION PATH_VAR PATH_HAS_VAR) #
cmake_path(CONVERT "$ENV{PATH}" TO_CMAKE_PATH_LIST PATH_CONVERT_VAR) #
cmake_path(NORMAL_PATH PATH_VAR OUTPUT_VARIABLE PATH_NORMAL_VAR) #
cmake_path(REMOVE_FILENAME PATH_VAR OUTPUT_VARIABLE PATH_REMOVE_VAR) #
execute_process(COMMAND echo "Hello" OUTPUT_VARIABLE EXE_OUT_VAR RESULT_VARIABLE EXE_RES_VAR ERROR_VARIABLE EXE_ERR_VAR) ###
file(READ "${CMAKE_CURRENT_LIST_DIR}/file-to-read" FILE_READ_VAR) #
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/file-to-read" FILE_STRINGS_VAR)#
file(SHA512 "${CMAKE_CURRENT_LIST_DIR}/file-to-read" FILE_HASH_VAR) #
file(TIMESTAMP "${CMAKE_CURRENT_LIST_DIR}/file-to-read" FILE_TIMESTAMP_VAR)#
file(SIZE "${CMAKE_CURRENT_LIST_DIR}/file-to-read" FILE_SIZE_VAR)#
file(REAL_PATH "${CMAKE_CURRENT_LIST_DIR}/file-to-read" FILE_REAL_VAR)#
file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}/file-to-read" FILE_CMAKE_VAR)#
file(GLOB FILE_GLOB_VAR "*") #
file(RELATIVE_PATH FILE_REL_VAR "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_CURRENT_LIST_DIR}/file-to-read" ) #
list(APPEND LIST_VAR2 "e1" "e2" "e3")#
list(APPEND LIST_VAR "e1" "e2" "e3")
list(POP_BACK LIST_VAR LIST_OUT_VAR) #
math(EXPR MATH_VAR "1 + 1") #
string(FIND "FINDME" "ME" STRING_FIND_VAR) #
string(REPLACE "ME" "" STRING_REPLACE_VAR "ALLABOUTMEME") #
string(REPEAT "REPEAT" "2" STRING_REPEAT_VAR) #
string(APPEND STRING_APPEND_VAR "APPENDME") #
string(PREPEND STRING_PREPEND_VAR "PREPENDME") #
string(TIMESTAMP STRING_TIME_VAR) #
string(UUID STRING_UUID_VAR NAMESPACE "6ba7b810-9dad-11d1-80b4-00c04fd430c8" NAME "test" TYPE SHA1) #
string(CONCAT STRING_CONCAT_VAR "abc" "123") #
string(SHA512 STRING_HASH_VAR "12345") #
string(JSON JSON_VAR ERROR_VARIABLE JSON_ERR_VAR GET "{\"test\": true}" "test") ##
string(REGEX REPLACE "TEST" "" STRING_REG_REPLACE_VAR "TEST123") #
string(REGEX MATCH "TEST" STRING_REG_MATCH_VAR "TEST123") #
string(SUBSTRING "ABCDEF" 0 3 STRING_SUB_VAR) #
string(ASCII 10 20 30 STRING_ASCII_VAR) #
string(HEX "1020" STRING_HEX_VAR) #
string(MAKE_C_IDENTIFIER "0x100" STRING_C_VAR) #
string(RANDOM STRING_RANDOM_VAR) #
string(COMPARE "EQUAL" "ABC" "123" STRING_COMPARE_VAR) #
# Not in ABI
if(0)
set(NOT_IN_ABI "TEST")
endif()
8 changes: 4 additions & 4 deletions azure-pipelines/end-to-end-tests-dir/compilertracking.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ $args = $commonArgs + @("--overlay-triplets=$PSScriptRoot/../e2e_ports/compilert
# Test simple installation
Run-Vcpkg -TestArgs ($args + @("install", "vcpkg-hello-world-1"))
Throw-IfFailed
if (-Not (select-string "^triplet_abi [0-9a-f]+-[0-9a-f]+-[0-9a-f]+$" "$installRoot/x64-linux/share/vcpkg-hello-world-1/vcpkg_abi_info.txt")) {
if (-Not (select-string "^toolchain_abi [0-9a-f]+-[0-9a-f]+$" "$installRoot/x64-linux/share/vcpkg-hello-world-1/vcpkg_abi_info.txt")) {
throw "Expected vcpkg-hello-world-1 to perform compiler detection"
}
Remove-Item -Recurse -Force $installRoot

Run-Vcpkg -TestArgs ($args + @("install", "vcpkg-hello-world-2"))
Throw-IfFailed
if (-Not (select-string "^triplet_abi [0-9a-f]+-[0-9a-f]+$" "$installRoot/x64-linux/share/vcpkg-hello-world-2/vcpkg_abi_info.txt")) {
if (-Not (select-string "^toolchain_abi [0-9a-f]+$" "$installRoot/x64-linux/share/vcpkg-hello-world-2/vcpkg_abi_info.txt")) {
throw "Expected vcpkg-hello-world-2 to not perform compiler detection"
}
Remove-Item -Recurse -Force $installRoot

Run-Vcpkg -TestArgs ($args + @("install", "vcpkg-hello-world-2", "vcpkg-hello-world-1"))
Throw-IfFailed
if (-Not (select-string "^triplet_abi [0-9a-f]+-[0-9a-f]+-[0-9a-f]+$" "$installRoot/x64-linux/share/vcpkg-hello-world-1/vcpkg_abi_info.txt")) {
if (-Not (select-string "^toolchain_abi [0-9a-f]+-[0-9a-f]+$" "$installRoot/x64-linux/share/vcpkg-hello-world-1/vcpkg_abi_info.txt")) {
throw "Expected vcpkg-hello-world-1 to perform compiler detection"
}
if (-Not (select-string "^triplet_abi [0-9a-f]+-[0-9a-f]+$" "$installRoot/x64-linux/share/vcpkg-hello-world-2/vcpkg_abi_info.txt")) {
if (-Not (select-string "^toolchain_abi [0-9a-f]+$" "$installRoot/x64-linux/share/vcpkg-hello-world-2/vcpkg_abi_info.txt")) {
throw "Expected vcpkg-hello-world-2 to not perform compiler detection"
}
3 changes: 3 additions & 0 deletions azure-pipelines/end-to-end-tests-dir/triplet-abi.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
. $PSScriptRoot/../end-to-end-tests-prelude.ps1
Run-Vcpkg "--overlay-triplets=$PSScriptRoot/../e2e_ports/triplet-abi" "--overlay-ports=$PSScriptRoot/../e2e_ports/triplet-abi" install vcpkg-test-triplet-abi --triplet x64-abi
Throw-IfFailed
10 changes: 7 additions & 3 deletions include/vcpkg-test/mockcmakevarprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace vcpkg::Test
dep_info_vars.emplace(spec, SMap{});
}

void load_tag_vars(Span<const FullPackageSpec> specs,
const PortFileProvider& port_provider,
Triplet host_triplet) const override
void load_tag_and_triplet_vars(Span<const FullPackageSpec> specs,
const PortFileProvider& port_provider,
Triplet host_triplet) const override
{
for (auto&& spec : specs)
tag_vars.emplace(spec.package_spec, SMap{});
Expand All @@ -37,8 +37,12 @@ namespace vcpkg::Test
Optional<const std::unordered_map<std::string, std::string>&> get_tag_vars(
const PackageSpec& spec) const override;

Optional<const std::unordered_map<std::string, std::string>&> get_triplet_vars(
const PackageSpec& spec) const override;

mutable std::unordered_map<PackageSpec, std::unordered_map<std::string, std::string>> dep_info_vars;
mutable std::unordered_map<PackageSpec, std::unordered_map<std::string, std::string>> tag_vars;
mutable std::unordered_map<PackageSpec, std::unordered_map<std::string, std::string>> triplet_vars;
mutable std::unordered_map<Triplet, std::unordered_map<std::string, std::string>> generic_triplet_vars;
};
}
15 changes: 15 additions & 0 deletions include/vcpkg/base/jsonreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <vcpkg/base/stringview.h>
#include <vcpkg/base/view.h>

#include <type_traits>

namespace vcpkg::Json
{
struct Reader;
Expand Down Expand Up @@ -312,6 +314,19 @@ namespace vcpkg::Json
static NaturalNumberDeserializer instance;
};

struct RealNumberDeserializer final : IDeserializer<double>
{
virtual StringView type_name() const override { return "a real number"; }

virtual Optional<double> visit_number(Reader&, double value) override
{
if (!std::isfinite(value)) return nullopt;
return value;
}

static RealNumberDeserializer instance;
};

struct BooleanDeserializer final : IDeserializer<bool>
{
virtual StringView type_name() const override { return "a boolean"; }
Expand Down
3 changes: 2 additions & 1 deletion include/vcpkg/base/system.process.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ namespace vcpkg

Command make_basic_cmake_cmd(const Path& cmake_tool_path,
const Path& cmake_script,
const std::vector<CMakeVariable>& pass_variables);
const std::vector<CMakeVariable>& pass_variables,
const std::vector<std::string>& additional_args = {});

Path get_exe_path_of_current_process();

Expand Down
4 changes: 2 additions & 2 deletions include/vcpkg/build.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ namespace vcpkg
explicit EnvCache(bool compiler_tracking) : m_compiler_tracking(compiler_tracking) { }

const Environment& get_action_env(const VcpkgPaths& paths, const AbiInfo& abi_info);
const std::string& get_triplet_info(const VcpkgPaths& paths, const AbiInfo& abi_info);
const std::string& get_toolchain_abi(const VcpkgPaths& paths, const AbiInfo& abi_info);
const CompilerInfo& get_compiler_info(const VcpkgPaths& paths, const AbiInfo& abi_info);

private:
Expand All @@ -415,7 +415,7 @@ namespace vcpkg
Cache<Path, TripletMapEntry> m_triplet_cache;
Cache<Path, std::string> m_toolchain_cache;

const TripletMapEntry& get_triplet_cache(const Filesystem& fs, const Path& p) const;
const TripletMapEntry& get_triplet_cache(const Path& p) const;

#if defined(_WIN32)
struct EnvMapEntry
Expand Down
3 changes: 2 additions & 1 deletion include/vcpkg/buildenvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ namespace vcpkg
{
Command make_cmake_cmd(const VcpkgPaths& paths,
const Path& cmake_script,
std::vector<CMakeVariable>&& pass_variables);
std::vector<CMakeVariable>&& pass_variables,
std::vector<std::string>&& additional_args = {});
}
31 changes: 28 additions & 3 deletions include/vcpkg/cmakevars.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,28 @@

namespace vcpkg::CMakeVars
{
struct CMakeTraceVersion
{
int major;
int minor;
};
struct CMakeTraceLine
{
std::vector<std::string> args;
std::string cmd;
Path file;
int frame;
int global_frame;
int line;
Optional<int> line_end;
double time;
};
struct CMakeTraceOutput
{
CMakeTraceVersion version;
std::vector<CMakeTraceLine> traces;
};

struct CMakeVarProvider
{
virtual ~CMakeVarProvider() = default;
Expand All @@ -27,13 +49,16 @@ namespace vcpkg::CMakeVars
virtual Optional<const std::unordered_map<std::string, std::string>&> get_tag_vars(
const PackageSpec& spec) const = 0;

virtual Optional<const std::unordered_map<std::string, std::string>&> get_triplet_vars(
const PackageSpec& spec) const = 0;

virtual void load_generic_triplet_vars(Triplet triplet) const = 0;

virtual void load_dep_info_vars(Span<const PackageSpec> specs, Triplet host_triplet) const = 0;

virtual void load_tag_vars(Span<const FullPackageSpec> specs,
const PortFileProvider& port_provider,
Triplet host_triplet) const = 0;
virtual void load_tag_and_triplet_vars(Span<const FullPackageSpec> specs,
const PortFileProvider& port_provider,
Triplet host_triplet) const = 0;

void load_tag_vars(const ActionPlan& action_plan,
const PortFileProvider& port_provider,
Expand Down
2 changes: 1 addition & 1 deletion include/vcpkg/vcpkgpaths.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ namespace vcpkg
Filesystem& get_filesystem() const;

const Environment& get_action_env(const AbiInfo& abi_info) const;
const std::string& get_triplet_info(const AbiInfo& abi_info) const;
const std::string& get_toolchain_abi(const AbiInfo& abi_info) const;
const CompilerInfo& get_compiler_info(const AbiInfo& abi_info) const;

const FeatureFlagSettings& get_feature_flags() const;
Expand Down
12 changes: 12 additions & 0 deletions src/vcpkg-test/mockcmakevarsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,16 @@ namespace vcpkg::Test
if (it == tag_vars.end()) return nullopt;
return it->second;
}

Optional<const std::unordered_map<std::string, std::string>&> MockCMakeVarProvider::get_triplet_vars(
const PackageSpec& spec) const
{
auto find_itr = triplet_vars.find(spec);
if (find_itr != triplet_vars.end())
{
return find_itr->second;
}

return nullopt;
}
}
1 change: 1 addition & 0 deletions src/vcpkg/base/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,7 @@ namespace vcpkg::Json
}

NaturalNumberDeserializer NaturalNumberDeserializer::instance;
RealNumberDeserializer RealNumberDeserializer::instance;
BooleanDeserializer BooleanDeserializer::instance;
ParagraphDeserializer ParagraphDeserializer::instance;
IdentifierDeserializer IdentifierDeserializer::instance;
Expand Down
7 changes: 6 additions & 1 deletion src/vcpkg/base/system.process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,14 @@ namespace vcpkg

Command make_basic_cmake_cmd(const Path& cmake_tool_path,
const Path& cmake_script,
const std::vector<CMakeVariable>& pass_variables)
const std::vector<CMakeVariable>& pass_variables,
const std::vector<std::string>& additional_args)
{
Command cmd{cmake_tool_path};
for (auto&& var : additional_args)
{
cmd.string_arg(var);
}
for (auto&& var : pass_variables)
{
cmd.string_arg(var.s);
Expand Down
Loading