That's probably an issue with linking because it doesn't know it has to link asan. <div>Either way, settings asan flags is the job of the user, not the cmakelists.txt.</div><div>Such things should be kept in tool chain or config files IMHO. </div><div>You can try running cmake in verbose mode for more information. <br><br><div class="gmail_quote"><div dir="ltr">Le jeu. 7 déc. 2017 à 09:25, Damien R <<a href="mailto:damienrg%2Blist@gmail.com">damienrg+list@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I am trying to use CHECK_CXX_COMPILER_FLAG with cmake 3.9 to check if the compiler supports asan.</div><div>The CMakeLists.txt is:</div><div><div>cmake_minimum_required(VERSION 3.9)</div><div>include(CheckCXXCompilerFlag)</div><div>check_cxx_compiler_flag("-fsanitize=address" COMPILER_SUPPORT_FLAG)</div></div><div><br></div><div>I always got:</div><div>-- Performing Test COMPILER_SUPPORT_FLAG - Failed<br></div><div><br></div><div>Even if the documentation say that CHECK_CXX_COMPILER_FLAG sets CMAKE_REQUIRED_DEFINITIONS by the name of the macro I thought that it would work.</div><div>Can you tell me why CHECK_CXX_COMPILER_FLAG use CMAKE_REQUIRED_DEFINITIONS instead of CMAKE_REQUIRED_FLAGS</div><div>and what is the official way for checking this flag?</div><div><br></div><div>Regards,</div><div><br></div><div>Damien R.</div><div><br></div></div>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="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" 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" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="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" 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" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a></blockquote></div></div>