Skip to content

Clean up construction of compiler flags

Paul McCarthy requested to merge mnt/c++standard into master
  • Flatten $FSLDIR/config directory by moving config/common/* into config/.
  • Set default C/C++ standards as -std=c99 / -std=c++11.
  • Honour CC, CXX, CFLAGS, CXXFLAGS, and LDFLAGS set by the environment - if unset, use defaults defined in buildSettings.mk.
  • Formalise and document construction of final CFLAGS/CXXFLAGS/LDFLAGS used in compilation of C/C++ projects:
    1. USRCFLAGS/USRCXXFLAGS/USRLDFLAGS are defined in project specific Makefiles, and have the highest precedence
    2. ARCHCFLAGS/ARCHCXXFLAGS/ARCHLDFLAGS are defined in buildSettings.mk, and have higher precedence over the environment
    3. CFLAGS/CXXFLAGS/LDFLAGS are provided by the environment (with fallback defaults in buildSettings.mk), and have the lowest precedence.
  • Do not set any C++ ABI compatibility flags - these can be provided by the environment
  • Honour CPPFLAGS, and allow projects to set USRCPPFLAGS, to control C/C++ preprocessor. Will probably never get used, but added for completeness.

Merge request reports

Loading