As very clearly stated in this commit: Restructure monolithic library builds · PixarAnimationStudios/OpenUSD@f5da4e2 · GitHub
When building a monolitic static OpenUSD, one needs to link with WHOLE_ARCHIVE to get all the symbols and properly initialize all the static vars and methods reqired for the initialization of the OpenUSD plugins.
That being said, using WHOLE_ARCHIVE means bringing in ALL the symbols from all compilation units.
While this is the easiest way, being able to build statically and force only certains symboks from compilation units to be added would be beneficial and would let us create much smaller binary packages containing only what we need.
WHOLE_ARCHIVE indeed works but it is also possible to specify which symbols to link with using --undefined in gcc or \UNDEFINED in MSVC.
I’ve been trying to make it work but so far I was not able to figure out which symbols were needed.
So was this ever considered and which symbols should I list for static OpenUSD to work ?
@tlewis