From: Tim Kientzle Date: Mon, 17 Nov 2025 00:17:54 +0000 (-0800) Subject: Merge pull request #2738 from cmcgee1024/add_clang_module_map X-Git-Tag: v3.8.3~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17526e5c5261e487f56032251d8478237ce87462;p=thirdparty%2Flibarchive.git Merge pull request #2738 from cmcgee1024/add_clang_module_map Add a clang module map for libarchive (cherry picked from commit c2333a511dd81de1f8a1c60fe131c9615f4d9277) --- diff --git a/libarchive/module.modulemap b/libarchive/module.modulemap new file mode 100644 index 000000000..70f70fc3a --- /dev/null +++ b/libarchive/module.modulemap @@ -0,0 +1,34 @@ +/* + * Clang Module Map for libarchive + * + * What this is: + * This file tells the Clang compiler how to treat libarchive as a "module" - + * a self-contained unit of code that can be imported all at once instead of + * including individual header files. Think of it like a package definition. + * + * How it works: + * - When you write `@import CArchive` (Objective-C) or `import CArchive` (Swift), + * the compiler uses this file to know which headers belong to libarchive + * - Instead of processing each #include separately, the compiler can load a + * pre-compiled version of the entire library, making builds faster + * - This also provides better dependency tracking and can catch issues like + * conflicting macro definitions between libraries + * + * When to update: + * Update this file whenever: + * - New public header files are added to libarchive's libarchive/ directory + * - Public headers are removed or renamed + * - The library's API structure changes significantly + * + * You typically don't need to update this for: + * - Internal implementation changes + * - Private/internal header modifications + * - Documentation updates + * + * NOTE: This only affects projects using Clang with modules enabled. Traditional + * #include-based builds will continue to work normally with or without this file. + */ +module CArchive { + header "archive.h" + header "archive_entry.h" +}