From beb827d154cdc96dfe3042034bb301f6134f4259 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 Aug 2020 11:37:22 +0200 Subject: Add target_triplet::representation() in addition to string() Also stop stripping `none-` prefix from the system component. --- libbutl/target-triplet.mxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'libbutl/target-triplet.mxx') diff --git a/libbutl/target-triplet.mxx b/libbutl/target-triplet.mxx index e68bc68..41c0cb5 100644 --- a/libbutl/target-triplet.mxx +++ b/libbutl/target-triplet.mxx @@ -61,8 +61,10 @@ LIBBUTL_MODEXPORT namespace butl // trailing version, again, to make SYSTEM easier to compare to. For example, // *-darwin14.5.0 becomes 'darwin' and '14.5.0'. // - // Again, to make things more regular, if the first component in SYSTEM is - // none, then it is removed (so *-none-eabi becomes just 'eabi'). + // Note also that sometimes the first component in SYSTEM can be 'none' (to + // indicate the absence of an operating system) which is ambigous with the + // vendor (for example, arm-none-eabi). We currently don't try to deal with + // that (that is, you will need to specify arm-unknown-none-eabi). // // Values for two-component systems (e.g., linux-gnu) that don't specify // VENDOR explicitly are inherently ambiguous: is 'linux' VENDOR or part of @@ -121,12 +123,20 @@ LIBBUTL_MODEXPORT namespace butl std::string version; std::string class_; - // Assemble and returning the canonical (i.e., the one we round-trip) + // Assemble and returning the canonical (i.e., without unknown vendor) // target triplet string. // + // Note: not necessarily round-tripp'able, see representation(). + // std::string string () const; + // Return a round-tripp'able target triplet string that always contains + // the vendor. + // + std::string + representation () const; + bool empty () const {return cpu.empty ();} -- cgit v1.1