<div dir="ltr">On Wed, Oct 30, 2013 at 11:19 AM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
On 30/10/2013 17:58, Rafael Espíndola wrote:<br>
> So the variable will be updated at every run of cmake, but this will<br>
> not cause cmake to run at every ninja/make invocation, right?<br>
<br>
</div>No, it'll still be an ordinary configure variable.<br></blockquote><div><br></div><div>To clarify, do you mean:</div><div><br></div><div>If a user never overrides CLANG_EXECUTABLE_VERSION, then changing the LLVM_VERSION_MAJOR and LLVM_VERSION_MINOR variables in llvm/CMakeLists.txt will change the version number we use when building clang.</div>
<div><br></div><div>If a user overrides CLANG_EXECUTABLE_VERSION, then their overridden value will be kept whenever cmake is rerun (for instance, when the LLVM version number changes).</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

The difference is that the value won't get stuck behind when the version<br>
in SVN/git changes, such as when you're doing a rebase locally or when<br>
3.4 gets released.<br>
<br>
To see what I mean, try building the previous three stable clang<br>
releases in your ordinary location -- odds are, they'll all be built as<br>
clang-3.4 and libclang.3.4.dylib/so.<br>
<br>
The previous behaviour meant that CMake was saving whatever the version<br>
number was the first time you built your SVN checkout, possibly years<br>
ago, and never updating it again which is a foreign concept to say the<br>
least :-)</blockquote><div><br></div><div>The previous behavior seems to be a bug to me. Please do fix it!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">> On 30 October 2013 13:51, Alp Toker <<a href="mailto:alp@nuanti.com">alp@nuanti.com</a>> wrote:<br>
>> Hello,<br>
>><br>
>> You may have noticed CMake-built versions of clang with unusual<br>
>> executable versions, for example a current TOT clang just got built as<br>
>> clang-3.2/libclang.3.2.dylib and another machine tracking LLVM SVN head<br>
>> is getting built under bin/clang-3.3 even after make clean.<br>
>><br>
>> This seems to have been causing confusion in LLVM.org bug reports for<br>
>> some time..<br>
>><br>
>> It turns out this happens because CLANG_EXECUTABLE_VERSION is set as a<br>
>> CACHE variable in CMakeLists.txt. So value gets cached to whatever the<br>
>> version was the *first time* you built LLVM and arbitrarily persists<br>
>> through version upgrades -- probably not what anyone wants. Likewise the<br>
>> libclang shared objects will get installed using whatever this value is<br>
>> in your cache.<br>
>><br>
>> I'm planning to make at least CLANG_EXECUTABLE_VERSION and<br>
>> LIBCLANG_LIBRARY_VERSION ordinary CMake variables in time for the new<br>
>> release. This means if you're tracking LLVM 3.4 and relying on (or<br>
>> shipping!) the binary installed as clang-3.1, clang-3.2 or clang-3.3<br>
>> it's now going to change to clang-3.4 in line with the configure-based<br>
>> system.<br>
>><br>
>> You'll still be able to tweak all the variables for your custom vendor<br>
>> distribution as usual using -DCLANG_EXECUTABLE_VERSION etc. or with the<br>
>> CMake GUI -- this change will just remove the hidden storage, but I<br>
>> wanted to give a heads up in case anyone is relying on that behaviour.<br>
>><br>
>> Incidentally there are various other CACHE variables in LLVM's build<br>
>> system, but they seem less problematic..<br>
>><br>
>><br>
>> CMakeLists.txt:  set(CLANG_PATH_TO_LLVM_SOURCE "" CACHE PATH<br>
>> CMakeLists.txt-    "Path to LLVM source code. Not necessary if using an<br>
>> installed LLVM.")<br>
>> CMakeLists.txt:  set(CLANG_PATH_TO_LLVM_BUILD "" CACHE PATH<br>
>> CMakeLists.txt-    "Path to the directory where LLVM was built or<br>
>> installed.")<br>
>> CMakeLists.txt-<br>
>> --<br>
>> CMakeLists.txt-    set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT}<br>
>> --no-progress-bar")<br>
>> CMakeLists.txt-  endif()<br>
>> CMakeLists.txt:  set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING<br>
>> "Default options for lit")<br>
>> CMakeLists.txt-<br>
>> CMakeLists.txt-  set( CMAKE_RUNTIME_OUTPUT_DIRECTORY<br>
>> ${CMAKE_BINARY_DIR}/bin )<br>
>> --<br>
>> CMakeLists.txt-endif()<br>
>> CMakeLists.txt-<br>
>> CMakeLists.txt:set(CLANG_RESOURCE_DIR "" CACHE STRING<br>
>> CMakeLists.txt-  "Relative directory from the Clang binary to its<br>
>> resource files.")<br>
>> CMakeLists.txt-<br>
>> CMakeLists.txt:set(C_INCLUDE_DIRS "" CACHE STRING<br>
>> CMakeLists.txt-  "Colon separated list of directories clang will search<br>
>> for headers.")<br>
>> CMakeLists.txt-<br>
>> CMakeLists.txt:set(GCC_INSTALL_PREFIX "" CACHE PATH "Directory where gcc<br>
>> is installed." )<br>
>> CMakeLists.txt:set(DEFAULT_SYSROOT "" CACHE PATH<br>
>> CMakeLists.txt-  "Default <path> to all compiler invocations for<br>
>> --sysroot=<path>." )<br>
>> CMakeLists.txt-<br>
>> CMakeLists.txt:set(CLANG_VENDOR "" CACHE STRING<br>
>> CMakeLists.txt-  "Vendor-specific text for showing with version<br>
>> information.")<br>
>> CMakeLists.txt-<br>
>> --<br>
>> CMakeLists.txt-endif()<br>
>> CMakeLists.txt-<br>
>> CMakeLists.txt:set(CLANG_REPOSITORY_STRING "" CACHE STRING<br>
>> CMakeLists.txt-  "Vendor-specific text for showing the repository the<br>
>> source is taken from.")<br>
>> CMakeLists.txt-<br>
>> --<br>
>> CMakeLists.txt-endif()<br>
>> CMakeLists.txt-<br>
>> CMakeLists.txt:set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING<br>
>> CMakeLists.txt-  "Vendor-specific uti.")<br>
>> CMakeLists.txt-<br>
>> --<br>
>> CMakeLists.txt-# Clang version information<br>
>> CMakeLists.txt-set(CLANG_EXECUTABLE_VERSION<br>
>> CMakeLists.txt:     "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}"<br>
>> CACHE STRING<br>
>> CMakeLists.txt-    "Version number that will be placed into the clang<br>
>> executable, in the form XX.YY")<br>
>> CMakeLists.txt-set(LIBCLANG_LIBRARY_VERSION<br>
>> CMakeLists.txt:     "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}"<br>
>> CACHE STRING<br>
>> CMakeLists.txt-    "Version number that will be placed into the libclang<br>
>> library , in the form XX.YY")<br>
>> CMakeLists.txt-mark_as_advanced(CLANG_EXECUTABLE_VERSION<br>
>> LIBCLANG_LIBRARY_VERSION)<br>
>> --<br>
>> CMakeLists.txt-endif()<br>
>> CMakeLists.txt-<br>
>> CMakeLists.txt:set(BUG_REPORT_URL "<a href="http://llvm.org/bugs/" target="_blank">http://llvm.org/bugs/</a>" CACHE STRING<br>
>> CMakeLists.txt-  "Default URL where bug reports are to be submitted.")<br>
>> CMakeLists.txt-<br>
>> CMakeLists.txt:set(CLANG_ORDER_FILE "" CACHE FILEPATH<br>
>> CMakeLists.txt-  "Order file to use when compiling clang in order to<br>
>> improve startup time.")<br>
>><br>
>><br>
>> Alp.<br>
>><br>
>><br>
>> --<br>
>> <a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
>> the browser experts<br>
>><br>
>> _______________________________________________<br>
>> cfe-dev mailing list<br>
>> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
--<br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div></div>