From ff9995f1e638ada66a68a54475adea7c9191916b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Mar 2021 17:17:53 +0200 Subject: Add recognition of *-apple-ios* target triplets, ios target class --- libbutl/target-triplet.cxx | 20 ++++++++++++++++++-- libbutl/target-triplet.mxx | 4 ++++ 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'libbutl') diff --git a/libbutl/target-triplet.cxx b/libbutl/target-triplet.cxx index db71e3c..611b758 100644 --- a/libbutl/target-triplet.cxx +++ b/libbutl/target-triplet.cxx @@ -129,6 +129,14 @@ namespace butl version.assign (system, v, string::npos); system.resize (system.size () - version.size ()); } + else if (vendor == "apple" && system.compare (0, 3, "ios") == 0) + { + // Handle iosNN[-...]. + // + string::size_type p (system.find ('-')); + version.assign (system, 3, p == string::npos ? p : p - 3); + system.erase (3, version.size ()); + } // Determine class for some recognized systems. // @@ -136,6 +144,8 @@ namespace butl class_ = "linux"; else if (vendor == "apple" && system == "darwin") class_ = "macos"; + else if (vendor == "apple" && system.compare (0, 3, "ios") == 0) + class_ = "ios"; else if (system == "freebsd" || system == "openbsd" || system == "netbsd") @@ -167,7 +177,10 @@ namespace butl if (!version.empty ()) { - r += version; + if (vendor == "apple" && system.compare (0, 3, "ios") == 0) + r.insert (r.size () - system.size () + 3, version); + else + r += version; } return r; @@ -191,7 +204,10 @@ namespace butl if (!version.empty ()) { - r += version; + if (vendor == "apple" && system.compare (0, 3, "ios") == 0) + r.insert (r.size () - system.size () + 3, version); + else + r += version; } return r; diff --git a/libbutl/target-triplet.mxx b/libbutl/target-triplet.mxx index 1ecc7e5..3861809 100644 --- a/libbutl/target-triplet.mxx +++ b/libbutl/target-triplet.mxx @@ -99,6 +99,9 @@ LIBBUTL_MODEXPORT namespace butl // x86_64-pc-windows-msvc19.11.25547 x86_64 windows-msvc 19.11.25547 // wasm32-unknown-emscripten wasm32 emscripten // arm64-apple-darwin20.1.0 aarch64 apple darwin 20.1.0 + // arm64-apple-ios14.4 aarch64 apple ios 14.4 + // arm64-apple-ios14.4-simulator aarch64 apple ios-simulator 14.4 + // x86_64-apple-ios14.4-macabi x86_64 apple ios-macabi 14.4 // // Similar to version splitting, for certain commonly-used targets we also // derive the "target class" which can be used as a shorthand, more @@ -110,6 +113,7 @@ LIBBUTL_MODEXPORT namespace butl // macos *-apple-darwin* // bsd *-*-(freebsd|openbsd|netbsd)* // windows *-*-win32-* | *-*-windows-* | *-*-mingw32 + // ios *-apple-ios* // // References: // -- cgit v1.1