How to build an LLVM pass through visual studio

I tried to build an LLVM pass in visual studio with cmake, but it seems add_LLVM_loadable_module macro doesn’t support non-unix and non-cygwin platform. Is loadable module necessary for LLVM pass? Could I just build a static library and pass it to opt? If static library is not supported, is there any way to build an LLVM pass through visual studio? Or through clang with cmake?

Loadable module is not supported with CMake on Win32.
FYI, as you know, on cygming (also mingw), "configure --enable-shared"
is available.

You cannot load external modules with opt. Instead, embed your pass in
opt (lib/Analysis and lib/Transforms), and build opt.