Skip to content

Bad CMake usage leading to compilation issues #897

@akallabeth

Description

@akallabeth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug reportSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions