From 556df3dae67cb0e84ba4e70bfd1f8b1766b5f7ee Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Tue, 20 Feb 2024 17:09:16 +0100 Subject: [PATCH] Fix building on mac --- include/communication/CommandLine.h | 7 +++---- src/communication/CommandLine.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/communication/CommandLine.h b/include/communication/CommandLine.h index 11b86e8e65..d27aa8121b 100644 --- a/include/communication/CommandLine.h +++ b/include/communication/CommandLine.h @@ -7,7 +7,6 @@ #include #include //Loading JSON documents to get settings from them. #include //To store the command line arguments. -#include #include //To store the command line arguments. #include "Communication.h" //The class we're implementing. @@ -156,7 +155,7 @@ class CommandLine : public Communication std::string progressHandler; #endif - std::unordered_set search_directories_; + std::vector search_directories_; /* * \brief The command line arguments that the application was called with. @@ -191,7 +190,7 @@ class CommandLine : public Communication */ int loadJSON( const rapidjson::Document& document, - const std::unordered_set& search_directories, + const std::vector& search_directories, Settings& settings, bool force_read_parent = false, bool force_read_nondefault = false); @@ -212,7 +211,7 @@ class CommandLine : public Communication * \param search_directories The directories to search in. * \return The first definition file that matches the definition ID. */ - static std::string findDefinitionFile(const std::string& definition_id, const std::unordered_set& search_directories); + static std::string findDefinitionFile(const std::string& definition_id, const std::vector& search_directories); }; } // namespace cura diff --git a/src/communication/CommandLine.cpp b/src/communication/CommandLine.cpp index 45b51d8dce..3c31f1f6cd 100644 --- a/src/communication/CommandLine.cpp +++ b/src/communication/CommandLine.cpp @@ -40,7 +40,7 @@ CommandLine::CommandLine(const std::vector& arguments) { if (auto search_paths = spdlog::details::os::getenv("CURA_ENGINE_SEARCH_PATH"); ! search_paths.empty()) { - search_directories_ = search_paths | views::split_paths | ranges::to>(); + search_directories_ = search_paths | views::split_paths | ranges::to>(); }; } @@ -242,7 +242,7 @@ void CommandLine::sliceNext() exit(1); } argument = arguments_[argument_index]; - search_directories_ = argument | views::split_paths | ranges::to>(); + search_directories_ = argument | views::split_paths | ranges::to>(); break; } case 'j': @@ -420,13 +420,13 @@ int CommandLine::loadJSON(const std::filesystem::path& json_filename, Settings& return 2; } - search_directories_.insert(std::filesystem::path(json_filename).parent_path()); + search_directories_.push_back(std::filesystem::path(json_filename).parent_path()); return loadJSON(json_document, search_directories_, settings, force_read_parent, force_read_nondefault); } int CommandLine::loadJSON( const rapidjson::Document& document, - const std::unordered_set& search_directories, + const std::vector& search_directories, Settings& settings, bool force_read_parent, bool force_read_nondefault) @@ -586,7 +586,7 @@ void CommandLine::loadJSONSettings(const rapidjson::Value& element, Settings& se } } -std::string CommandLine::findDefinitionFile(const std::string& definition_id, const std::unordered_set& search_directories) +std::string CommandLine::findDefinitionFile(const std::string& definition_id, const std::vector& search_directories) { for (const auto& search_directory : search_directories) {