obsproject / obs-plugintemplate

GNU General Public License v2.0
307 stars 141 forks source link

cmake: Force PDB generation on Windows for MSVC builds in all configs #107

Closed pkviet closed 11 months ago

pkviet commented 11 months ago

Description

This is a bugfix written by PatTheMav for obs-studio which applies equally to obs-plugintemplate. Quote [1]: CMake 3.25 changed the way PDB generation is handled by only enabling it for Debug and RelWithDebInfo builds, which prohibits generation of fully optimized builds with associated symbols (which is MSVC's default).

If configuring with CMake 3.25 or above, enable this globally for builds using MSVC and fall back to embedded debug information for anything else (which would probably be clang-cl)

Motivation and Context

CI builds tags as Release. As a result, there's no pdb generated. It is desirable to ship pdb for better user support.

How Has This Been Tested?

Tested on a third-party plugin. The pdb are generated now in Release builds.

Types of changes

Checklist: