Skip to content

[release_rai_1_8] Remove explicit /Zi and /DEBUG, use CMAKE_MSVC_DEBUG_INFORMATION_FORMAT#317

Open
shbhamid-amd wants to merge 1 commit into
Xilinx:release_rai_1_8from
shbhamid-amd:fix/remove-explicit-Zi-debug-flags-rai-1.8
Open

[release_rai_1_8] Remove explicit /Zi and /DEBUG, use CMAKE_MSVC_DEBUG_INFORMATION_FORMAT#317
shbhamid-amd wants to merge 1 commit into
Xilinx:release_rai_1_8from
shbhamid-amd:fix/remove-explicit-Zi-debug-flags-rai-1.8

Conversation

@shbhamid-amd

Copy link
Copy Markdown

Summary

  • Remove unconditional /Zi compiler flag from add_compile_options in cmake/windows.cmake
  • Remove unconditional /DEBUG linker flag from add_link_options
  • Add CMAKE_MSVC_DEBUG_INFORMATION_FORMAT set to ProgramDatabase only for Debug and RelWithDebInfo configurations

Why

The current setup forces PDB generation (/Zi) and debug linking (/DEBUG) unconditionally across all build configurations including Release. This increases binary size and build time for release builds unnecessarily.

By using CMAKE_MSVC_DEBUG_INFORMATION_FORMAT with a generator expression, PDBs are only generated for Debug and RelWithDebInfo where they are actually needed.

This upstreams the xmc monorepo patch (aiebu_no_explicit_Zi.patch) for the release_rai_1_8 branch.

Changes

  • cmake/windows.cmake: Removed /Zi from compile options, removed /DEBUG from link options, added CMAKE_MSVC_DEBUG_INFORMATION_FORMAT with config-conditional generator expression

Test plan

  • Verify aiebu builds successfully on Windows (MSVC) in Release configuration
  • Verify aiebu builds successfully on Windows (MSVC) in Debug configuration
  • Confirm PDB files are generated for Debug/RelWithDebInfo but not Release
  • Once merged, retire aiebu_no_explicit_Zi.patch from xmc patches/ on release_rai_1_8

Signed-off-by: Shiva Shanker Bhamidipati [email protected]

Remove unconditional /Zi compiler flag and /DEBUG linker flag that forced
PDB generation across all build configurations including Release. Replace
with CMAKE_MSVC_DEBUG_INFORMATION_FORMAT using a generator expression so
PDBs are only generated for Debug and RelWithDebInfo.

This reduces binary size and build time for Release builds.

Signed-off-by: Shiva Shanker Bhamidipati <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants