chore: Refactor vcpkg.json and update CMake configurations
- Removed the abseil dependency from vcpkg.json for Windows platform. - Updated CMake configuration to prevent finding system-installed protobuf and abseil, ensuring gRPC uses bundled versions. - Modified todo_manager.cc to convert paths to strings for consistency. - Updated vision_action_refiner.cc to explicitly convert stripped whitespace strings to std::string. - Added undefinitions for Windows macros in z3ed_network_client.cc to avoid conflicts with method names.
This commit is contained in:
@@ -18,11 +18,11 @@ set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
|
||||
|
||||
set(FETCHCONTENT_QUIET OFF)
|
||||
|
||||
# CRITICAL: Prevent CMake from finding system-installed protobuf
|
||||
# CRITICAL: Prevent CMake from finding system-installed protobuf/abseil
|
||||
# This ensures gRPC uses its own bundled versions
|
||||
# NOTE: We allow gRPC to use our FetchContent abseil to keep versions in sync
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_Protobuf TRUE)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_gRPC TRUE)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_absl TRUE)
|
||||
|
||||
# Also prevent pkg-config from finding system packages
|
||||
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH FALSE)
|
||||
|
||||
@@ -53,9 +53,9 @@ TodoItem::Status TodoItem::StringToStatus(const std::string& str) {
|
||||
TodoManager::TodoManager() {
|
||||
auto result = util::PlatformPaths::GetAppDataSubdirectory("agent");
|
||||
if (result.ok()) {
|
||||
data_dir_ = *result;
|
||||
data_dir_ = result->string();
|
||||
} else {
|
||||
data_dir_ = std::filesystem::current_path() / ".yaze" / "agent";
|
||||
data_dir_ = (std::filesystem::current_path() / ".yaze" / "agent").string();
|
||||
}
|
||||
todos_file_ = (std::filesystem::path(data_dir_) / "todos.json").string();
|
||||
}
|
||||
|
||||
@@ -110,9 +110,9 @@ absl::StatusOr<ActionRefinement> VisionActionRefiner::RefineAction(
|
||||
std::vector<std::string> parts = absl::StrSplit(coords, ',');
|
||||
if (parts.size() == 2) {
|
||||
refinement.adjusted_parameters["x"] =
|
||||
absl::StripAsciiWhitespace(parts[0]);
|
||||
std::string(absl::StripAsciiWhitespace(parts[0]));
|
||||
refinement.adjusted_parameters["y"] =
|
||||
absl::StripAsciiWhitespace(parts[1]);
|
||||
std::string(absl::StripAsciiWhitespace(parts[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,8 +167,8 @@ VisionActionRefiner::LocateUIElement(
|
||||
std::string coords = text.substr(pos + 1, end - pos - 1);
|
||||
std::vector<std::string> parts = absl::StrSplit(coords, ',');
|
||||
if (parts.size() == 2) {
|
||||
location["x"] = absl::StripAsciiWhitespace(parts[0]);
|
||||
location["y"] = absl::StripAsciiWhitespace(parts[1]);
|
||||
location["x"] = std::string(absl::StripAsciiWhitespace(parts[0]));
|
||||
location["y"] = std::string(absl::StripAsciiWhitespace(parts[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -324,7 +324,7 @@ VisionAnalysisResult VisionActionRefiner::ParseVerificationResponse(
|
||||
size_t pos = response_upper.find("SUCCESS:");
|
||||
if (pos != std::string::npos) {
|
||||
std::string desc = response.substr(pos + 8);
|
||||
result.description = absl::StripAsciiWhitespace(desc);
|
||||
result.description = std::string(absl::StripAsciiWhitespace(desc));
|
||||
}
|
||||
}
|
||||
else if (response_upper.find("FAILURE") != std::string::npos) {
|
||||
|
||||
@@ -16,6 +16,14 @@
|
||||
#include "httplib.h"
|
||||
#endif
|
||||
|
||||
// Undefine Windows macros that conflict with our method names
|
||||
// Must be outside the #ifdef so it applies to all code below
|
||||
#ifdef _WIN32
|
||||
#ifdef SendMessage
|
||||
#undef SendMessage
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
namespace net {
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
"default-features": false,
|
||||
"features": []
|
||||
},
|
||||
{
|
||||
"name": "abseil",
|
||||
"platform": "windows"
|
||||
},
|
||||
{
|
||||
"name": "yaml-cpp",
|
||||
"platform": "windows"
|
||||
|
||||
Reference in New Issue
Block a user