# How to prevent CMake to add an empty /Fd flag

**URL:** https://discourse.cmake.org/t/how-to-prevent-cmake-to-add-an-empty-fd-flag/14357
**Category:** Usage
**Tags:** os:windows, gen:ninja, lang:fortran
**Created:** [July 14, 2025, 2:30pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-to-add-an-empty-fd-flag/14357 "2025-07-14T14:30:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ElBorak3](https://discourse.cmake.org/user_avatar/discourse.cmake.org/elborak3/32/5475_2.png) [@ElBorak3](https://discourse.cmake.org/u/ElBorak3)
#### Post date: [July 14, 2025, 2:30pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-to-add-an-empty-fd-flag/14357/1 "2025-07-14T14:30:48Z")

</div>

In CMake, while using the ninja generator, when I try to build my fortran project, an empty /Fd flag (the flag used to specify the path name of the generated .pdb) is always set at the end of the command passed to the ifort compiler. I am trying to generate multiple static libraries (.lib). I tried forcing the /Fd flag with the correct path by using CMAKE\_Fortran\_FLAGS\_DEBUG but it then gets overwritten by the empty /Fd flag added by CMake. Setting the target properties COMPILE\_PDB\_OUTPUT\_DIRECTORY or COMPILE\_PDB\_NAME does not affect the empty flag /Fd added. My goal here is to have a single .PDB generated by every static library that I generate. Note that I am using the Intel Ifort compiler and I am using ninja as my generator. Is there any way I can solve this problem or force the right /Fd flag at the END of the command passed to Ifort so that it overwrites correctly?
