While I can set different warning levels depending on the compiler, e.g.:
if(MSVC)
target_compile_options(${TARGET_NAME} PRIVATE /W4 /WX)
else()
target_compile_options(${TARGET_NAME} PRIVATE -Wall -Wextra -pedantic -Werror)
endif()
I cannot set them on a file by file basis.
In the same directory, I have a set of files whose names are in the ${SRC_WARN}
CMake variable, which need a different warning level compared to the others.
Is there a way to specify such a condition with target_compile_options
?