cmake puts compiler flags in link commands on ninja file


We are using CMake 3.21 and Ninja 1.10.2 under Windows and Linux.
We are experimental using Intel oneApi icx compiler.
At the linking step we get a warning (Linux)
clang++: warning: argument unused during compilation: ‘-inline-level=0’ [-Wunused-command-line-argument]
After inspecting the Ninja file I found out that is set
FLAGS = compile flags
in the linking step. I think this is unnecessary, can this be disabled?

Thanks in advance and best regards

Where did you specify the -inline-level=0 compiler flag? CMAKE_CXX_FLAGS are used any time the CMAKE_CXX_COMPILER is called, even when used to drive linking. There are other ways to add compile-only flags, such as target_compile_options.

We set global C, CXX , Fortran Compile flags.
in the CMAKE_###_FLAGS variable


Is it possible to set the compile flags to zero for the target which get’s linked?
I…e remove compile flags via properties?

Best regards