Suppress link warnings with CMake

I know how to suppress compilation warnings with CMake (suppose I want to disable compilation warning C4819):

set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/wd4819")

So, how to suppress link warnings using CMake (say LNK4099)?

+4
source share
2 answers

Try the following:

set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/ignore:4099")

It worked great for me with Visual Studio 2015.

+10
source

The answer is so obvious that I even doubt whether I am right. In any case, you need the LINK_FLAGS property.

+1
source

Source: https://habr.com/ru/post/1625445/


All Articles