ADD FLAGS TO CLION C PROJECT

已回答

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

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

请先登录再写评论。