<div class="gmail_quote">On Thu, May 24, 2012 at 10:08 AM, Brad King <span dir="ltr">&lt;<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.com</a>&gt;</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 05/24/2012 12:22 PM, Justin Holewinski wrote:<br>
&gt; I narrowed the problem down to Clang not having Platform/Windows-Clang-{C,CXX}.cmake files.<br>
<br>
</div>There is an issue tracker entry for this:<br>
<br>
  <a href="http://www.cmake.org/Bug/view.php?id=13035" target="_blank">http://www.cmake.org/Bug/view.php?id=13035</a><br>
<br>
but it is in the backlog waiting for more feedback and a volunteer.<br>
The main problem is distinguishing the GNU-compatible and MS-compatible<br>
builds of Clang.<br></blockquote><div><br></div><div>Oops, missed that issue.  Sorry about that!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
&gt;  If I add the following two files then everything starts to work as expected:<br>
&gt;<br>
&gt; Platform/Windows-Clang-C.cmake:<br>
&gt;<br>
&gt; if(MINGW)<br>
&gt;   include(Platform/Windows-GNU)<br>
&gt;   __windows_compiler_gnu(C)<br>
&gt; else()<br>
&gt;   # Chain to generic Windows configuration<br>
&gt;   include(Platform/Windows)<br>
&gt; endif()<br>
&gt;<br>
&gt; Platform/Windows-Clang-CXX.cmake:<br>
&gt;<br>
&gt; if(MINGW)<br>
&gt;   include(Platform/Windows-GNU)<br>
&gt;   __windows_compiler_gnu(C)<br>
&gt; else()<br>
&gt;   # Chain to generic Windows configuration<br>
&gt;   include(Platform/Windows)<br>
&gt; endif()<br>
&gt;<br>
&gt; This way, using Clang with MinGW will force GNU-style platform<br>
&gt; options instead of VS-style Windows options.<br>
&gt; Is this more or less the &quot;right way&quot; to fix this in CMake?<br>
<br>
</div>Interesting approach.  That may be better than separating the<br>
compiler id as mentioned in the above-linked issue.  The &quot;MINGW&quot;<br>
value is set based on CMAKE_C_PLATFORM_ID which is computed in<br>
the same way and at the same time as CMAKE_C_COMPILER_ID.  Try:<br>
<br>
 $ cat Platform/Windows-Clang-C.cmake<br>
 if(&quot;${CMAKE_C_PLATFORM_ID}&quot; MATCHES &quot;MinGW&quot;)<br>
   include(Platform/Windows-GNU-C)<br>
 else()<br>
   include(Platform/Windows-cl)<br>
 endif()<br>
<br>
 $ cat Platform/Windows-Clang-CXX.cmake<br>
 if(&quot;${CMAKE_CXX_PLATFORM_ID}&quot; MATCHES &quot;MinGW&quot;)<br>
   include(Platform/Windows-GNU-CXX)<br>
 else()<br>
   include(Platform/Windows-cl)<br>
 endif()<br>
<br>
Do you have both the MS-style and GNU-style Clang available<br>
to test?<br></blockquote><div><br></div><div>This works for the MinGW build.  I really can&#39;t say if this fixes the library naming issue for the MS-style Clang.  Clang does not have a VC-compatible driver (that I know of) so does not accept VC-style arguments like &quot;/O2&quot;, which causes CMake to fail early on in the configure process when using the NMake generator.  Clang with MinGW is the only really supported configuration at this point.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
-Brad<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div><br>