An open-source DWG viewer doesn't exist at the moment. The closest thing we have to an open-source DWG library is...

Commenting post 2: An open-source DWG viewer doesn't exist at the moment. The closest thing we have to an open-source DWG library is LibreDWG, but AFAIK there is no application using it. For a DXF viewer, however, there is LibreCAD that is very good.