Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler is not GNU or Flang! Aborting... #76

Open
evan1026 opened this issue Oct 28, 2022 · 2 comments
Open

Compiler is not GNU or Flang! Aborting... #76

evan1026 opened this issue Oct 28, 2022 · 2 comments

Comments

@evan1026
Copy link

I am getting the above error when trying to add coverage flags to my project. It seems to be related to checking the compilers for each of the available languages.

Relevant CMake code:

# Debug info to help with this issue
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
message("ALL LANGUAGES: ${LANGUAGES}")
foreach(LANG ${LANGUAGES})
    message("${LANG} compiler is \"${CMAKE_${LANG}_COMPILER_ID}\"")
endforeach()

# Error hit by this line
include(CodeCoverage)

Relevant output of CMake:

ALL LANGUAGES: ASM;C;CXX;NONE
ASM compiler is ""
C compiler is "Clang"
CXX compiler is "Clang"
NONE compiler is ""
CMake Error at lib/cmake-modules/CodeCoverage.cmake:159 (message):
  Compiler is not GNU or Flang! Aborting...
Call Stack (most recent call first):
  CMakeLists.txt:132 (include)

Please let me know if there's any more information I can provide

@stiggy87
Copy link

stiggy87 commented Jan 25, 2023

I ran into this. I had to make sure any project() I have all the languages I'm using in there.

I do think that the cmake should be updated to ignore the ones that are not set.

@benner
Copy link

benner commented May 17, 2023

@stiggy87 solution helped me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants