diff options
author | Sadie Powell <sadie@witchery.services> | 2020-10-15 17:13:57 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-10-15 17:15:28 +0100 |
commit | 78c79a379af12e8fdf9ea8008f30f7fc18df1f36 (patch) | |
tree | eaf9cf4ed7a05a98b97a3f723a37296b486cc24a /make/configure.pm | |
parent | ff88faf931e390e30a994b69fff1ce17bf134029 (diff) |
More consistently show modules without the file prefix and suffix.
Diffstat (limited to 'make/configure.pm')
-rw-r--r-- | make/configure.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/make/configure.pm b/make/configure.pm index fd1833d5f..763423be6 100644 --- a/make/configure.pm +++ b/make/configure.pm @@ -52,6 +52,8 @@ our @EXPORT = qw(CONFIGURE_CACHE_FILE run_test test_file test_header + module_expand + module_shrink write_configure_cache get_compiler_info find_compiler @@ -221,6 +223,18 @@ sub test_header($$;$) { return !$?; } +sub module_expand($) { + my $module = shift; + $module = "m_$module" unless $module =~ /^(?:m|core)_/; + $module = "$module.cpp" unless $module =~ /\.cpp$/; + return $module; +} + +sub module_shrink($) { + my $module = basename shift; + return $module =~ s/(?:^m_|\.cpp$)//gr; +} + sub write_configure_cache(%) { unless (-e CONFIGURE_DIRECTORY) { print_format "Creating <|GREEN ${\abs2rel CONFIGURE_DIRECTORY, CONFIGURE_ROOT}|> ...\n"; |