<div dir="auto">Hi,<div dir="auto"><br></div><div dir="auto">If your CMake version is newer than 3.11 you can control what gets into the CMAKE_<Lang>_FLAGS_INIT flags with the technique from <a href="https://cristianadam.eu/20190223/modifying-the-default-cmake-build-types/">https://cristianadam.eu/20190223/modifying-the-default-cmake-build-types/</a></div><div dir="auto"><br></div><div dir="auto">In your case you want to remove from the linker flags init the cxx compiler options.</div><div dir="auto"><br></div><div dir="auto">Cheers</div><div dir="auto">Cristian.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 27, 2019, 03:10 Jayesh Badwaik <<a href="mailto:badwaik.jayesh@gmail.com">badwaik.jayesh@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
In <a href="https://gitlab.kitware.com/cmake/cmake/issues/19074" rel="noreferrer noreferrer" target="_blank">https://gitlab.kitware.com/cmake/cmake/issues/19074</a>, it was mentioned that <br>
instead of `add_compile_options`, `CMAKE_CXX_FLAGS_INIT` should be used. An <br>
issue with this is that `CMAKE_CXX_FLAGS_INIT` flags are propogated to the <br>
linker as well, wherein, the linker warns about `[-Wunused-command-line-<br>
argument]` if those warnings are enabled. <br>
<br>
Is there an alternative to `CMAKE_CXX_FLAGS_INIT` which avoids these issues? <br>
<br>
Thanks<br>
<br>
-- <br>
Best<br>
Jayesh Badwaik<br>
<a href="https://jayeshbadwaik.github.io" rel="noreferrer noreferrer" target="_blank">https://jayeshbadwaik.github.io</a><br>
<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>