Skip to content

Modules: Refactor compile features and GNU language standard flags

Refactor various modules as was previously done in !9314 (merged).

These commits originally existed as part of that MR. However, it was requested that these changes be moved into a new MR for testing purposes. Specifically, the following changes have been made:

  • The cmake_determine_compile_features() macro has been renamed to cmake_determine_compiler_support(), and is now located in ${CMAKE_ROOT}\Modules\CMakeDetermineCompilerSupport.cmake. (The name of the macro has been changed because the changes in !9314 (merged) expand it to also attempt to define other variables related to language support.)

  • The method used to define the various CMAKE_<LANG><STANDARD>_STANDARD_COMPILE_OPTION and CMAKE_<LANG><STANDARD>_EXTENSION_COMPILE_OPTION variables for GCC has been changed. The ${CMAKE_ROOT}\Modules\Compiler\GNU.cmake script now includes two new macros, called __compiler_gnu_c_standards() and __compiler_gnu_cxx_standards(). These are used to define the relevant compile option variables for C- and C++-based languages, respectively. (This change was motivated by the need to specify language support for Objective C and Objective C++ for !9314 (merged).)

Topic-rename: refactor-compile-features-and-flags

Edited by Tyler Nichols

Merge request reports

Loading