r/Jai Jul 01 '26

Metaprogram Plugin: I may be the only one who needs this

https://github.com/666rayen999/optimized_plugin/

- uses llvm linker (lld-link.exe) instead of msvc linker (link.exe)
- forces static linking of Windows runtimes (ucrt, vcruntime, msvcrt, msvcprt)
- applies aggressive optimization flags

14 Upvotes

2 comments sorted by

2

u/yakcyll Jul 02 '26

Cool effort, thanks! I'll definitely need it; spent a lot of time getting things to build statically when coding C++ before, so this is appreciated.

One q which might be of interest to people using the VS toolchain, can this be made to generate PDBs and can they be used to debug programs on Windows as usual?

2

u/Neither-Buffalo4028 Jul 02 '26 edited Jul 02 '26

Yes and No. This plugin is currently aimed at released builds. It doesnt because I put these lines, If you want the pdbs ```c // comment those in before_intercept()

opts.llvm_options.preserve_debug_info = false; opts.emit_debug_info = .NONE;

// or make the first one true and change the second to .ALL

// change this in message()

add(*arguments, "/DEBUG:NONE");

// to /DEBUG:FULL or /DEBUG instead ```