larsch / cmake-precompiled-header

Visual Studio and GCC precompiled header macro for CMake
160 stars 42 forks source link

Release flags are not picked to generate pch file #20

Open dlaugt opened 5 years ago

dlaugt commented 5 years ago

For gcc in release mode, -DNDEBUG flag is missing when pch is generated.

As the pch is not generated with the same flags, it is not used during the compilation of objects. For example, the following warning appears: precompiled.h.gch/.c++: not used because `__NO_INLINE__' not defined [-Winvalid-pch]

Could we have the same flags for the pch generation and the compilation?