I'm working on a C project whose CMakeLists.txt
has the following:
set_property(
TARGET foo
APPEND PROPERTY COMPILE_OPTIONS -Wall
)
This was fine as long as I could assume the compiler would be gcc or clang, which I was assuming. But - for MSVC, -Wall
means something else and undesirable, so I want to set other switches. How can I / how should I go about doing this?
Note: I'm not asking which compiler options to use, I'm asking how to apply my choices of flags (or any other property) using CMake.