<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Takumi,<div class=""><br class=""></div><div class="">The proper way to detect multi-configuration mode is:</div><div class=""><br class=""></div><div class="">if (NOT CMAKE_CONFIGURATION_TYPES)</div><div class=""><br class=""></div><div class="">In multi-configuration CMAKE_CONFIGURATION_TYPES will list all the configuration types that will be supported (<a href="http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_CONFIGURATION_TYPES.html" class="">http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_CONFIGURATION_TYPES.html</a>).</div><div class=""><br class=""></div><div class="">-Chris</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 11, 2015, at 1:45 AM, NAKAMURA Takumi via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I am using it to detect multiconfiguration mode in llvm/utils/llvm-lit/CMakeLists.txt.<div class=""><br class=""></div><div class="">if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")<br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Aug 11, 2015 at 5:42 PM Kuperstein, Michael M <<a href="mailto:michael.m.kuperstein@intel.com" class="">michael.m.kuperstein@intel.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple" class="">
<div class=""><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="">Yes, because it doesn’t set any CMAKE_BUILD_TYPE by default, which is, IMO, just fine for VS.<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="">That’s what bit me an hour ago, had to re-configure manually with a random (from my perspective) CMAKE_BUILD_TYPE.<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><a name="msg-f:1509197149272659982__MailEndCompose" class=""><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class=""><u class=""></u> <u class=""></u></span></a></p><p class="MsoNormal"><b class=""><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" class="">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" class=""> NAKAMURA Takumi [mailto:<a href="mailto:geek4civic@gmail.com" target="_blank" class="">geek4civic@gmail.com</a>]
<br class="">
<b class="">Sent:</b> Tuesday, August 11, 2015 11:37<br class="">
<b class="">To:</b> Kuperstein, Michael M; Yaron Keren<br class="">
<b class="">Cc:</b> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a></span></p></div></div><div lang="EN-US" link="blue" vlink="purple" class=""><div class=""><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" class=""><br class="">
<b class="">Subject:</b> Re: [llvm] r244406 - cmake: Error on invalid CMAKE_BUILD_TYPE<u class=""></u><u class=""></u></span></p></div></div><div lang="EN-US" link="blue" vlink="purple" class=""><div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<div class=""><p class="MsoNormal" style="line-height:115%">FYI, a failing build; <a href="http://bb.pgr.jp/builders/msbuild-llvmclang-x64-msc18-DA/builds/475" target="_blank" class="">http://bb.pgr.jp/builders/msbuild-llvmclang-x64-msc18-DA/builds/475</a><u class=""></u><u class=""></u></p>
</div><p class="MsoNormal" style="line-height:115%"><u class=""></u> <u class=""></u></p>
<div class="">
<div class=""><p class="MsoNormal" style="line-height:115%">On Tue, Aug 11, 2015 at 5:19 PM Kuperstein, Michael M via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>> wrote:<u class=""></u><u class=""></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm" class="">
<div class="">
<div class=""><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="">I agree it’s very slow, but it’s still a valid configuration - especially when debugging tablegen
 itself. :-)</span><u class=""></u><u class=""></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="">Whether LLVM_OPTIMIZED_TABLEGEN should be the default is a separate question.</span><u class=""></u><u class=""></u></p><p class="MsoNormal"><a name="msg-f:1509197149272659982_msg-f:1509195668862102604__MailEndCompos" class=""><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class=""> </span></a><u class=""></u><u class=""></u></p><p class="MsoNormal"><b class=""><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" class="">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" class=""> Yaron Keren [mailto:<a href="mailto:yaron.keren@gmail.com" target="_blank" class="">yaron.keren@gmail.com</a>]
<br class="">
<b class="">Sent:</b> Tuesday, August 11, 2015 11:04<br class="">
<b class="">To:</b> Kuperstein, Michael M<br class="">
<b class="">Cc:</b> Justin Bogner; <a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">
llvm-commits@lists.llvm.org</a><br class="">
<b class="">Subject:</b> Re: [llvm] r244406 - cmake: Error on invalid CMAKE_BUILD_TYPE</span><u class=""></u><u class=""></u></p>
</div>
</div>
<div class="">
<div class=""><p class="MsoNormal"> <u class=""></u><u class=""></u></p>
<div class="">
<div class=""><p class="MsoNormal" style="line-height:115%">
It errors when the build is not one of the known:<span style="font-size:9.5pt;line-height:115%" class="">Debug|Release|RelWithDebInfo|MinSizeRel.</span><u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal" style="line-height:115%">
<span style="font-size:9.5pt;line-height:115%" class="">An invalid argument is always an error and without this patch the build just goes on.</span><u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal" style="line-height:115%">
 <u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal" style="line-height:115%">
<span style="font-size:9.5pt;line-height:115%" class="">For Visual C++ you don't have to specify CMAKE_BUILD_TYPE as CMAKE creates a multi solution but it still significant. Without CMAKE_BUILD_TYPE and without LLVM_OPTIMIZED_TABLEGEN, tablegen will be built in Debug
 config which is really slow. </span><u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal" style="line-height:115%">
 <u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal" style="line-height:115%">
 <u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal" dir="RTL" style="text-align:right;line-height:115%;direction:rtl">
<span dir="LTR" class=""> <u class=""></u><u class=""></u></span></p>
<div class="">
<div class=""><p class="MsoNormal" style="line-height:115%">
2015-08-11 10:43 GMT+03:00 Kuperstein, Michael M via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>>:<span lang="HE" dir="RTL" class=""><u class=""></u><u class=""></u></span></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt" class=""><p class="MsoNormal" dir="RTL" style="text-align:right;line-height:115%;direction:rtl">
<span dir="LTR" class="">Hi Justin</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>,<br class="">
<br class="">
</span><span dir="LTR" class="">I'm not sure erroring out makes sense when generating for Visual Studio (since the solution is always generated with all build types</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>).<br class="">
</span><span dir="LTR" class="">Perhaps disable it for VS</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>?<br class="">
<br class="">
</span><span dir="LTR" class="">Thanks</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>,<br class="">
  </span><span dir="LTR" class="">Michael</span><span lang="HE" class=""><br class="">
<br class="">
-----</span><span dir="LTR" class="">Original Message</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>-----<br class="">
</span><span dir="LTR" class="">From: llvm-commits [mailto</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>:<a href="mailto:llvm-commits-bounces@lists.llvm.org" target="_blank" class=""><span lang="EN-US" dir="LTR" class="">llvm-commits-bounces@lists.llvm.org</span></a><span dir="RTL" class=""></span><span dir="RTL" class=""></span>]
</span><span dir="LTR" class="">On Behalf Of Justin Bogner via llvm-commits</span><span lang="HE" class=""><br class="">
</span><span dir="LTR" class="">Sent: Sunday, August 09, 2015 00:05</span><span lang="HE" class=""><br class="">
</span><span dir="LTR" class="">To</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>:
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class=""><span lang="EN-US" dir="LTR" class="">llvm-commits@lists.llvm.org</span></a><br class="">
</span><span dir="LTR" class="">Subject: [llvm] r244406 - cmake: Error on invalid CMAKE_BUILD_TYPE</span><span lang="HE" class=""><br class="">
<br class="">
</span><span dir="LTR" class="">Author: bogner</span><span lang="HE" class=""><br class="">
</span><span dir="LTR" class="">Date: Sat Aug</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>  8 16:04:45 2015<br class="">
</span><span dir="LTR" class="">New Revision: 244406</span><span lang="HE" class=""><br class="">
<br class="">
</span><span dir="LTR" class="">URL</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>:
<a href="http://llvm.org/viewvc/llvm-project?rev=244406&view=rev" target="_blank" class="">
<span lang="EN-US" dir="LTR" class="">http://llvm.org/viewvc/llvm-project?rev=244406</span><span dir="RTL" class=""></span><span dir="RTL" class=""></span>&<span lang="EN-US" dir="LTR" class="">view=rev</span></a><br class="">
</span><span dir="LTR" class="">Log</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>:<br class="">
</span><span dir="LTR" class="">cmake: Error on invalid CMAKE_BUILD_TYPE</span><span lang="HE" class=""><br class="">
<br class="">
</span><span dir="LTR" class="">Apparently if you make a typo in the argument to CMAKE_BUILD_TYPE, cmake silently accepts this but doesn't apply any particular build type to your build. This means you get a build that doesn't really make any sense - it's sort of a debug
 build with asserts disabled</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>.<br class="">
<br class="">
</span><span dir="LTR" class="">Error out instead</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>.<br class="">
<br class="">
</span><span dir="LTR" class="">Modified</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>:<br class="">
    </span><span dir="LTR" class="">llvm/trunk/CMakeLists.txt</span><span lang="HE" class=""><br class="">
<br class="">
</span><span dir="LTR" class="">Modified: llvm/trunk/CMakeLists.txt</span><span lang="HE" class=""><br class="">
</span><span dir="LTR" class="">URL</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>:
<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=244406&r1=244405&r2=244406&view=diff" target="_blank" class="">
<span lang="EN-US" dir="LTR" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=244406</span><span dir="RTL" class=""></span><span dir="RTL" class=""></span>&<span lang="EN-US" dir="LTR" class="">r1=244405</span><span dir="RTL" class=""></span><span dir="RTL" class=""></span>&<span lang="EN-US" dir="LTR" class="">r2=244406</span><span dir="RTL" class=""></span><span dir="RTL" class=""></span>&<span lang="EN-US" dir="LTR" class="">view=diff</span></a><br class="">
==============================================================================<br class="">
--- </span><span dir="LTR" class="">llvm/trunk/CMakeLists.txt (original</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>)<br class="">
+++ </span><span dir="LTR" class="">llvm/trunk/CMakeLists.txt Sat Aug</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>  8 16:04:45 2015<br class="">
@@ -7,6 +7,11 @@ </span><span dir="LTR" class="">if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C</span><span lang="HE" class=""><br class="">
   </span><span dir="LTR" class="">set(CMAKE_BUILD_TYPE</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span> "</span><span dir="LTR" class="">Debug</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>")<br class="">
 </span><span dir="LTR" class="">endif</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>()<br class="">
<br class="">
+</span><span dir="LTR" class="">if (CMAKE_BUILD_TYPE AND</span><span lang="HE" class=""><br class="">
+    </span><span dir="LTR" class="">NOT CMAKE_BUILD_TYPE MATCHES</span><span lang="HE" class=""><br class="">
+"^(</span><span dir="LTR" class="">Debug|Release|RelWithDebInfo|MinSizeRel</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>)$")<br class="">
+  </span><span dir="LTR" class="">message(FATAL_ERROR</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span> "</span><span dir="LTR" class="">Invalid value for CMAKE_BUILD_TYPE</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>:<br class="">
+${</span><span dir="LTR" class="">CMAKE_BUILD_TYPE</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>}")<br class="">
+</span><span dir="LTR" class="">endif</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>()<br class="">
+<br class="">
 </span><span dir="LTR" class="">if(POLICY CMP0022</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>)<br class="">
   </span><span dir="LTR" class="">cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required</span><span lang="HE" class=""><br class="">
 </span><span dir="LTR" class="">endif</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>()<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
</span><span dir="LTR" class="">llvm-commits mailing list</span><span lang="HE" class=""><br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class=""><span lang="EN-US" dir="LTR" class="">llvm-commits@lists.llvm.org</span></a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank" class=""><span lang="EN-US" dir="LTR" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</span></a><br class="">
---------------------------------------------------------------------<br class="">
</span><span dir="LTR" class="">Intel Israel (74) Limited</span><span lang="HE" class=""><br class="">
<br class="">
</span><span dir="LTR" class="">This e-mail and any attachments may contain confidential material for</span><span lang="HE" class=""><br class="">
</span><span dir="LTR" class="">the sole use of the intended recipient(s). Any review or distribution</span><span lang="HE" class=""><br class="">
</span><span dir="LTR" class="">by others is strictly prohibited. If you are not the intended</span><span lang="HE" class=""><br class="">
</span><span dir="LTR" class="">recipient, please contact the sender and delete all copies</span><span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span>.<br class="">
_______________________________________________<br class="">
</span><span dir="LTR" class="">llvm-commits mailing list</span><span lang="HE" class=""><br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class=""><span lang="EN-US" dir="LTR" class="">llvm-commits@lists.llvm.org</span></a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank" class=""><span lang="EN-US" dir="LTR" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</span></a></span><span dir="LTR" class=""><u class=""></u><u class=""></u></span></p>
</blockquote>
</div><p class="MsoNormal" dir="RTL" style="text-align:right;line-height:115%;direction:rtl">
<span dir="RTL" class=""></span><span lang="HE" class=""><span dir="RTL" class=""></span> <u class=""></u><u class=""></u></span></p>
</div>
</div>
</div>
</div>
<div class=""><p class=""><span dir="LTR" class=""></span><span dir="LTR" class=""></span>---------------------------------------------------------------------<br class="">
Intel Israel (74) Limited<span lang="HE" dir="RTL" class=""><u class=""></u><u class=""></u></span></p><p class="">This e-mail and any attachments may contain confidential material for<br class="">
the sole use of the intended recipient(s). Any review or distribution<br class="">
by others is strictly prohibited. If you are not the intended<br class="">
recipient, please contact the sender and delete all copies.<u class=""></u><u class=""></u></p>
</div><p class="MsoNormal" style="line-height:115%">_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><u class=""></u><u class=""></u></p>
</blockquote>
</div>
</div></div><div lang="EN-US" link="blue" vlink="purple" class=""><p class="">---------------------------------------------------------------------<br class="">
Intel Israel (74) Limited</p><p class="">This e-mail and any attachments may contain confidential material for<br class="">
the sole use of the intended recipient(s). Any review or distribution<br class="">
by others is strictly prohibited. If you are not the intended<br class="">
recipient, please contact the sender and delete all copies.</p></div></blockquote></div>
_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></blockquote></div><br class=""></div></body></html>