问题
Crashpad is an error reporting system for c++ apps. https://chromium.googlesource.com/crashpad/crashpad/+/HEAD/doc/developing.md
build instructions are
$ cd ~/crashpad/crashpad
$ gn gen out/Default
$ ninja -C out/Default
I can build predefined static libs but I have not found a way how to use gn or ninja to generate the shared libraries.
回答1:
After running gn gen out\Default, you can edit the out\Default\toolchain.ninja file to add extra compiler flags to the command for the cc and cxx rules.
rule cc
command = ninja -t msvc -e environment.amd64 -- cl.exe ... ${cflags} ${cflags_c} /c ...
add the /MD compiler flag after the others, here ^
回答2:
after you generate ninja files, for each ninja file find the switch /MTd (debug) or /MT (release version) and change it to /MDd or /MD so the dynamic libs will be created
then you can build crashpad with ninja, the output is still lib files so they will be included in the exe file when you link them to your project (you do not have to add them to your project as using dlls).
来源:https://stackoverflow.com/questions/55302553/how-to-build-dynamic-shared-libraries-of-crashpad