<div dir="ltr">The patch was attempting to mimic autoconf's behaviour...<div><br></div><div>I am not sure to follow you Eric : do you mean this should not be an option any more, and must always be set in autoconf and cmake ? It would then just be a question of using the c++1 features (or not). In this case, I believe a should at least check that the compiler supports '-std=c++11' (or a different wording for non gcc compatible compilers). This would also be the right place to check the compiler is a version recent enough as well to build llvm --- in accrodance with c++11 switch huge discussion.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 22, 2013 at 12:26 AM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Nov 21, 2013 at 2:25 PM, Meador Inge <<a href="mailto:meadori@codesourcery.com">meadori@codesourcery.com</a>> wrote:<br>

> On 11/21/2013 04:04 PM, Arnaud Allard de Grandmaison wrote:<br>
><br>
>> In some cases, like when building llvm+lldb with cmake, llvm has to be built in<br>
>> c++11 mode. This patch adds the handling of this option. The default is OFF for<br>
>> now, but I suspect it will move to ON pretty soon given the discussions on the<br>
>> move to c++11 for the llvm codebase.<br>
><br>
> I am not sure why this is any better than -DCMAKE_CXX_FLAGS=-std=c++11, but<br>
> maybe someone else can argue that point.  Also, if/when we switch it seems like<br>
> the option is no longer useful since disabling means LLVM won't build after<br>
> folks start using C++11 features.<br>
><br>
<br>
</div>*shrug* We can remove the option at that point. I've had one in the<br>
autoconf side for the last few years.<br>
<br>
-eric<br>
<div><div class="h5"><br>
>> diff --git a/CMakeLists.txt b/CMakeLists.txt<br>
>> index f43204f..40cc7b6 100644<br>
>> --- a/CMakeLists.txt<br>
>> +++ b/CMakeLists.txt<br>
>> @@ -179,6 +179,7 @@ else( MSVC )<br>
>>    option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)<br>
>>  endif()<br>
>><br>
>> +option(LLVM_ENABLE_CXX11 "Compile with C++11 enabled." OFF)<br>
><br>
> Should this be documented: <a href="http://llvm.org/docs/CMake.html" target="_blank">http://llvm.org/docs/CMake.html</a> ?<br>
><br>
>>  option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)<br>
>>  option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)<br>
>><br>
>> diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake<br>
>> index bb41a58..71a5d25 100644<br>
>> --- a/cmake/modules/HandleLLVMOptions.cmake<br>
>> +++ b/cmake/modules/HandleLLVMOptions.cmake<br>
>> @@ -246,6 +246,10 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )<br>
>>    if (LLVM_ENABLE_WERROR)<br>
>>      add_llvm_definitions( -Werror )<br>
>>    endif (LLVM_ENABLE_WERROR)<br>
>> +  if (LLVM_ENABLE_CXX11)<br>
>> +    check_cxx_compiler_flag("-Werror -std=c++11" CXX_SUPPORTS_CXX11)<br>
><br>
> Why do you need to check for "-Werror" too?<br>
><br>
>> +    append_if(CXX_SUPPORTS_CXX11 "-std=c++11" CMAKE_CXX_FLAGS)<br>
>> +  endif (LLVM_ENABLE_CXX11)<br>
>>  endif( MSVC )<br>
>><br>
>>  macro(append_common_sanitizer_flags)<br>
>> -- 1.8.3.2<br>
><br>
><br>
> --<br>
> Meador Inge<br>
> CodeSourcery / Mentor Embedded<br>
</div></div>> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>