using --app:lib switch will auto generate DllMain on Windows.
how can I disable this behavior and write my own DllMain?
after doing some research, turn out this is easy to solve
add --nomain cmd line option.
declare NimMain like this
proc NimMain() {.cdecl, importc.}
call NimMain() from my own DllMain when reasonforcall is DLL_PROCESS_ATTACH