[CMake] CHECK_CXX_ACCEPTS_FLAG delieverts wrong result

Hendrik Sattler post at hendrik-sattler.de
Tue Sep 24 13:13:48 EDT 2013



"Fetzer, Andreas" <a.fetzer at Dkfz-Heidelberg.de> schrieb:
>Hi,
>
>I am using Mac OS X 10.7 with Apple clang version 3.1. At the moment
>our build fails due to an unknown compiler flag:
>
>error: unknown warning option '-Wstrict-null-sentinel'
>[-Werror,-Wunknown-warning-option]
>
>Although we are checking whether the flag is accepted by the selected
>compiler. When I use the following statement:
>
>
>    CHECK_CXX_ACCEPTS_FLAG(${_cxxflag} HAS_FLAG)
>
>    if(NOT HAS_FLAG)
>
>      message("Flag check failure ${_cxxflag}")
>
>    else()
>
>      message("Flag ${_cxxflag} accepted")
>
>    endif()
>
>Cmake tells me that the '-Wstrict-null-sentinel' flag is accepted. Is
>this a bug in Cmake or am I doing something wrong?
>I use Cmake 2.8.8
>
>Thanks in advance!
>
>Best regards
>Andreas
>
>
>
>------------------------------------------------------------------------
>
>--
>
>Powered by www.kitware.com
>
>Please keep messages on-topic and check the CMake FAQ at:
>http://www.cmake.org/Wiki/CMake_FAQ
>
>Kitware offers various services to support the CMake community. For
>more information on each offering, please visit:
>
>CMake Support: http://cmake.org/cmake/help/support.html
>CMake Consulting: http://cmake.org/cmake/help/consulting.html
>CMake Training Courses: http://cmake.org/cmake/help/training.html
>
>Visit other Kitware open-source projects at
>http://www.kitware.com/opensource/opensource.html
>
>Follow this link to subscribe/unsubscribe:
>http://www.cmake.org/mailman/listinfo/cmake

Hi, 

the clang error message already tells you what other option are needed so that clang rejects unknown -W options: -Werror

HS




More information about the CMake mailing list