<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">If cmake happens to detect GCC for the C compiler and Clang for the C++ compiler, then a manual override of either the C compiler or SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG is required.  This has been happening on my Darwin build environments:<div><br></div><div><div>-- The C compiler identification is GNU 4.2.1</div><div>-- The CXX compiler identification is Clang 4.1.0</div><div><br></div><div>Without the manual overrides, all C sources fail to compile with:</div><div><br></div><div><div><font face="Menlo">[  4%] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regcomp.c.o</font></div><div><font face="Menlo">cd /Users/jabbey/src/llvmCommit/build/lib/Support && /usr/bin/gcc  -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -I/Users/jabbey/src/llvmCommit/build/lib/Support -I/Users/jabbey/src/llvmCommit/lib/Support -I/Users/jabbey/src/llvmCommit/build/include -I/Users/jabbey/src/llvmCommit/include    -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -Wcovered-switch-default -fno-exceptions -o CMakeFiles/LLVMSupport.dir/regcomp.c.o   -c /Users/jabbey/src/llvmCommit/lib/Support/regcomp.c</font></div><div><b><font face="Menlo">cc1: error: unrecognized command line option "-Wcovered-switch-default"</font></b></div></div><div><br></div><div>The problem stems from HandleLLVMOptions.cmake where a single check of the warning option is performed using check_cxx_compiler_flag, and then upon success add_llvm_definitions appends to the flag to a list consumed by both C and CXX compilers.  </div><div><br></div><div>Attached is a patch which updates HandleLLVMOptions.cmake to:</div><div>  - Test C and CXX compiler separately for -Wcovered-switch-default</div><div>  - Split SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG into a C and CXX variant</div><div>  - Replace set( ${variable} "${variable} arg") with list( append $variable "arg" )</div><div>  - Check cmake_minimum_required of at least CMake 2.4 (where list append was introduced).</div><div><br></div><div>Ok to commit?</div><div><br></div><div>Joe </div><div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" face="Verdana" size="2" color="#052090"><b>______________________________</b></font></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" face="Verdana" size="2" color="#052090"><b>Joe Abbey</b></font></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" face="Verdana" size="2" color="#052090">Director of Software Development</font></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" face="Verdana" size="2" color="#052090">Arxan Technologies</font></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span"><a href="mailto:jabbey@arxan.com" style="color: blue; "><font class="Apple-style-span" face="Verdana" size="2" color="#0433ff">jabbey@arxan.com</font></a><font class="Apple-style-span" style="font-family: Calibri, sans-serif; font-size: 15px; "> </font></font><span class="Apple-style-span" style="color: rgb(169, 169, 169); border-collapse: separate; border-spacing: 0px; "><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><font class="Apple-style-span" face="Verdana"><a href="http://www.arxan.com/" style="color: rgb(0, 0, 0); "><font class="Apple-style-span" color="#ff9324" size="2">www.arxan.com</font></a></font></span></span></span></span></div></span></div></span></div></span></div></span></div></span></span><span class="Apple-style-span" style="color: rgb(169, 169, 169); border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><span class="Apple-style-span" style="font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; -webkit-text-decorations-in-effect: underline; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><font class="Apple-style-span" face="Verdana"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font size="2">Protecting the App Economy™</font></div></span></div></span></div></span></div></div></font></span></span></span></span></div></span><br class="Apple-interchange-newline">
</div>
</div></div></body></html>