targets: move target specs to spec/targets

Signed-off-by: David Wood <david@davidtw.co>
This commit is contained in:
David Wood 2023-11-08 14:25:34 +08:00
parent 76aa83e3e1
commit 1af256fe8a
No known key found for this signature in database
231 changed files with 26 additions and 26 deletions

View file

@ -1408,14 +1408,16 @@ impl fmt::Display for StackProtector {
macro_rules! supported_targets {
( $(($triple:literal, $module:ident),)+ ) => {
$(mod $module;)+
mod targets {
$(pub(crate) mod $module;)+
}
/// List of supported targets
pub const TARGETS: &[&str] = &[$($triple),+];
fn load_builtin(target: &str) -> Option<Target> {
let mut t = match target {
$( $triple => $module::target(), )+
$( $triple => targets::$module::target(), )+
_ => return None,
};
t.is_builtin = true;
@ -1431,7 +1433,7 @@ macro_rules! supported_targets {
$(
#[test] // `#[test]`
fn $module() {
tests_impl::test_target(super::$module::target());
tests_impl::test_target(crate::spec::targets::$module::target());
}
)+
}