@@ -263,9 +263,10 @@ soname = "libmydriver.so.1"
263263exports = " abi/mydriver.exports" # or inline: exports = ["vk_icd*"]
264264```
265265
266- ** Omitting the key publishes everything, which is what both platforms already
267- do** — ELF gives symbols default visibility, and PE gets an auto-generated
268- ` .def ` listing every symbol. ` exports ` narrows that.
266+ Omitting ` exports ` leaves ELF and Mach-O's native visibility rules in effect.
267+ On the MSVC ABI, mcpp discovers exportable external definitions unless an input
268+ already declares exports or ` auto_export = false ` disables discovery. ` exports `
269+ narrows the linker's published set.
269270
270271Two projects need the narrowing. A ** runtime with a stable ABI** publishes a
271272reviewed set and nothing else, so that what is not in the set stays free to
@@ -300,6 +301,31 @@ A `soname` is meaningful on `kind = "lib"` too — see
300301[ ` dependency_linkage ` ] ( #dependency_linkage--static-or-shared-is-the-consumers-decision )
301302below, where the form a library takes becomes the consumer's decision.
302303
304+ #### ` auto_export ` — native export control on the MSVC ABI (unreleased)
305+
306+ The key and LLVM bitcode discovery require an unreleased source build; they are
307+ not available in mcpp 2026.10.3.1. A target that supplies its own export control
308+ can omit the automatic export-discovery step:
309+
310+ ``` toml
311+ [targets .plugin ]
312+ kind = " shared"
313+ auto_export = false
314+ ```
315+
316+ The boolean defaults to ` true ` and applies only to PE shared libraries on the
317+ MSVC ABI, including clang and clang-cl. It applies when a library target is
318+ built as a dependency too. It has no effect on static libraries, executables,
319+ ELF, Mach-O or MinGW. Native ` __declspec(dllexport) ` , linker flags and explicit
320+ ` exports ` lists remain effective when discovery is disabled.
321+
322+ With discovery enabled, any input's explicit export intent suppresses automatic
323+ exports for the whole DLL. COFF directives are checked first. LLVM bitcode is
324+ inspected with the selected LLVM compiler, including ` dllexport ` declarations
325+ and linker-option metadata. Only an unannotated DLL needs candidate enumeration;
326+ bitcode candidates come from ` llvm-nm ` beside that compiler. Both FullLTO and
327+ ThinLTO inputs can be mixed with ordinary COFF objects.
328+
303329#### ` windows_subsystem ` and ` windows_entry ` — a Windows GUI executable (mcpp 2026.9.12.2+)
304330
305331``` toml
0 commit comments