Currently the main CMakeLists.txt does contain a couple of unclean usage.
CMake variables like CMAKE_POSITION_INDEPENDENT_CODE is hardcoded ON (just an example, there are others as well). Should be set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE STRING "default value") so they can be overwritten by configuration
CMAKE_C_FLAGS are unconditionally set with no way to tell use the configuration defined values only. This leads to compilation errors due to multiple definitions (an example is -D_FORTIFY_SOURCE=2 which will collide with packaging systems providing another value for that)
so, suggested fix is to move all these configuration options to an optional toolchain or include file keeping the build system clean from such stuff or at least allow turning them off.
Currently the main
CMakeLists.txtdoes contain a couple of unclean usage.CMakevariables likeCMAKE_POSITION_INDEPENDENT_CODEis hardcodedON(just an example, there are others as well). Should beset(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE STRING "default value")so they can be overwritten by configurationCMAKE_C_FLAGSare unconditionally set with no way to tell use the configuration defined values only. This leads to compilation errors due to multiple definitions (an example is-D_FORTIFY_SOURCE=2which will collide with packaging systems providing another value for that)so, suggested fix is to move all these configuration options to an optional toolchain or include file keeping the build system clean from such stuff or at least allow turning them off.