From 4577986fa24ddc41a1b494545a299f0392c87935 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 26 Dec 2022 13:01:10 +0200 Subject: [PATCH] Allow architecture specifications to be refined after creation --- source/architecture.cpp | 12 ++++++++++++ source/architecture.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/source/architecture.cpp b/source/architecture.cpp index 9662bba..5f8aea0 100644 --- a/source/architecture.cpp +++ b/source/architecture.cpp @@ -138,6 +138,17 @@ Architecture::Architecture(Builder &b, const string &spec): toolchain = "gnu"; } + update(); +} + +void Architecture::refine(const string &spec) +{ + parse_specification(spec); + update(); +} + +void Architecture::update() +{ name = type; if(!cpu.empty()) name += format("-%s", cpu); @@ -145,6 +156,7 @@ Architecture::Architecture(Builder &b, const string &spec): name += format("-%s", fpu); name += format("-%d-%s-%s", bits, system, toolchain); + filename_patterns.clear(); if(system=="windows") { add_pattern("%.dll"); diff --git a/source/architecture.h b/source/architecture.h index 4642080..6a17c3e 100644 --- a/source/architecture.h +++ b/source/architecture.h @@ -37,6 +37,11 @@ private: public: Architecture(Builder &b, const std::string &spec); + void refine(const std::string &); +private: + void update(); + +public: const std::string &get_type() const { return type; } const std::string &get_name() const { return name; } const std::string &get_system() const { return system; } -- 2.45.2