cmake vs no-assert flags

Jan Palus atler at pld-linux.org
Sat Mar 8 13:02:26 CET 2025


On 07.03.2025 18:58, Jakub Bogusz wrote:
> Adding %set_build_flags in %cmake macro broke no-assert flags passing
> in:
> 
>     -DCMAKE_CXX_FLAGS_PLD="${CXXFLAGS:-%{rpmcxxflags} -DNDEBUG -DQT_NO_DEBUG}" \\\
>     -DCMAKE_C_FLAGS_PLD="${CFLAGS:-%{rpmcflags} -DNDEBUG -DQT_NO_DEBUG}" \\\
>     -DCMAKE_Fortran_FLAGS_PLD="${CFLAGS:-%{rpmcflags} -DNDEBUG -DQT_NO_DEBUG}" \\\
> 
> because CXXFLAGS/CFLAGS env variables are now defined before.
> 
> Maybe -DNDEBUG -DQT_NO_DEBUG should be added to flags regardless of build system?

Seems reasonable to me. Maybe even better as there is nothing specific
about these flags that make them cmake exclusive. I'd guard them with
%{!?debug} this time though.


More information about the pld-devel-en mailing list