ADD FLAGS TO CLION C PROJECT

Answered

hey i have added these lines to the cmakelists file and it does not work, can you tell me what is wrong ?

set(GCC_COVERAGE_COMPILE_FLAGS "gcc−g−Wall−ansi−Wpedantic−Wextra  convert . c−o  convert")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
0
2 comments

Hello!

You should specify compiler flags in the first line, not the entire gcc command for compiling. So it should be:

set(GCC_COVERAGE_COMPILE_FLAGS "−Wall −ansi −Wpedantic −Wextra")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
0

Here is our quick CMake tutorial, it might be useful to you: https://www.jetbrains.com/help/clion/quick-cmake-tutorial.html.

0

Please sign in to leave a comment.