Skip to content

Do not define CMake variables from environment (CMAKE_C_COMPILER=$CC) #1881

@Flamefire

Description

@Flamefire

The CMakeMake EB does set a couple of CMake Cache vars:

This is not required as all but really ancient versions (<2.7) of CMake do this automatically. This was only recently documented but has been "always" the case. So setting -DCMAKE_C_COMPILER="$CC" is not required.

In addition to simplifying the EB code this also avoids warnings: On projects using only C++ CMake will spit out warnings:

CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_C_COMPILER
    CMAKE_C_FLAGS
    CMAKE_Fortran_COMPILER
    CMAKE_Fortran_FLAGS

Caveat: CMake will only use the environment variables on the first call, aka no CMakeCache exists. But as EB cleans the build folder first this is given.

In favor for a warning-free build I'd suggest to remove that code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions