cmakecflags

How to build CMake with particular C flags


I'm trying to build CMake with options that outlaws the variable-length array feature in C, to find out if CMake depend on this feature.

Note that I'm building CMake, not using CMake to build something else.


Solution

  • Seeking through the bootstrap script and found this:

      CC=*) CC=`cmake_arg "$1"` ;;
      CXX=*) CXX=`cmake_arg "$1"` ;;
      CFLAGS=*) CFLAGS=`cmake_arg "$1"` ;;
      CXXFLAGS=*) CXXFLAGS=`cmake_arg "$1"` ;;
      LDFLAGS=*) LDFLAGS=`cmake_arg "$1"` ;;
    

    Looks like invoking ./configure CFLAGS="-Werror=vla" will do.