<div dir="ltr"><div>Hi Sean,</div><div><br></div><div>The discussion all ended up happening on the lists rather than in the review. E.g.</div><div><a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150525/thread.html#278895">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150525/thread.html#278895</a><br></div><div><br></div><div>FWIW, I reverted this commit in r238744 as it failed on some clang-cl self-host bots. I've been updating the thread above with my findings on why. If I'm lucky I'll have a patch for clang-cl that fixes the issue up for review relatively soon.</div><div><br></div><div class="gmail_extra">-Greg</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 June 2015 at 02:40, Sean Silva <span dir="ltr"><<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Did this ever get discussed? <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D7828&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=x7204Rz3acR6e5YRnrBhSkpTmUe07Ro1RVEQ3nSkfXI&s=6YN9Y49-z-LZoIDBjhQhHpKAsrFID6psYRqWpMu-Dug&e=" style="font-size:13px" target="_blank">http://reviews.llvm.org/D7828</a> seems empty.<span class=""><font color="#888888"><div><br></div><div>-- Sean Silva</div></font></span></div><div class=""><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 1, 2015 at 5:41 AM, Greg Bedwell <span dir="ltr"><<a href="mailto:greg_bedwell@sn.scee.net" target="_blank">greg_bedwell@sn.scee.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: gbedwell<br>
Date: Mon Jun 1 07:41:55 2015<br>
New Revision: 238740<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D238740-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=x7204Rz3acR6e5YRnrBhSkpTmUe07Ro1RVEQ3nSkfXI&s=NPOOhqt5dzBIz2iPE8FKA3Ru6Y9_gw37Omhnz8yxglc&e=" target="_blank">http://llvm.org/viewvc/llvm-project?rev=238740&view=rev</a><br>
Log:<br>
In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.<br>
<br>
This embeds Windows version information into our executables and DLLs.<br>
The most visible place to view this data is in the details tab of the file<br>
properties window in Windows explorer.<br>
<br>
Differential Revision: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D7828&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=x7204Rz3acR6e5YRnrBhSkpTmUe07Ro1RVEQ3nSkfXI&s=6YN9Y49-z-LZoIDBjhQhHpKAsrFID6psYRqWpMu-Dug&e=" target="_blank">http://reviews.llvm.org/D7828</a><br>
<br>
Added:<br>
llvm/trunk/resources/<br>
llvm/trunk/resources/windows_version_resource.rc<br>
Modified:<br>
llvm/trunk/cmake/modules/AddLLVM.cmake<br>
<br>
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_cmake_modules_AddLLVM.cmake-3Frev-3D238740-26r1-3D238739-26r2-3D238740-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=x7204Rz3acR6e5YRnrBhSkpTmUe07Ro1RVEQ3nSkfXI&s=hg5kANbD97TRZwlckSuJPY97CTXGj9hNquEFzpniU-E&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=238740&r1=238739&r2=238740&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)<br>
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Mon Jun 1 07:41:55 2015<br>
@@ -228,6 +228,78 @@ function(set_output_directory target bin<br>
endif()<br>
endfunction()<br>
<br>
+# If on Windows and building with MSVC, add the resource script containing the<br>
+# VERSIONINFO data to the project. This embeds version resource information<br>
+# into the output .exe or .dll.<br>
+# TODO: Enable for MinGW Windows builds too.<br>
+#<br>
+function(add_windows_version_resource_file OUT_VAR)<br>
+ set(sources ${ARGN})<br>
+ if (MSVC)<br>
+ set(resource_file ${LLVM_SOURCE_DIR}/resources/windows_version_resource.rc)<br>
+ set(sources ${sources} ${resource_file})<br>
+ source_group("Resource Files" ${resource_file})<br>
+ set(windows_resource_file ${resource_file} PARENT_SCOPE)<br>
+ endif(MSVC)<br>
+<br>
+ set(${OUT_VAR} ${sources} PARENT_SCOPE)<br>
+endfunction(add_windows_version_resource_file)<br>
+<br>
+# set_windows_version_resource_properties(name resource_file...<br>
+# VERSION_MAJOR int<br>
+# Optional major version number (defaults to LLVM_VERSION_MAJOR)<br>
+# VERSION_MINOR int<br>
+# Optional minor version number (defaults to LLVM_VERSION_MINOR)<br>
+# VERSION_PATCHLEVEL int<br>
+# Optional patchlevel version number (defaults to LLVM_VERSION_PATCH)<br>
+# VERSION_STRING<br>
+# Optional version string (defaults to PACKAGE_VERSION)<br>
+# PRODUCT_NAME<br>
+# Optional product name string (defaults to "LLVM")<br>
+# )<br>
+function(set_windows_version_resource_properties name resource_file)<br>
+ cmake_parse_arguments(ARG<br>
+ ""<br>
+ "VERSION_MAJOR;VERSION_MINOR;VERSION_PATCHLEVEL;VERSION_STRING;PRODUCT_NAME"<br>
+ ""<br>
+ ${ARGN})<br>
+<br>
+ if (NOT DEFINED ARG_VERSION_MAJOR)<br>
+ set(ARG_VERSION_MAJOR ${LLVM_VERSION_MAJOR})<br>
+ endif()<br>
+<br>
+ if (NOT DEFINED ARG_VERSION_MINOR)<br>
+ set(ARG_VERSION_MINOR ${LLVM_VERSION_MINOR})<br>
+ endif()<br>
+<br>
+ if (NOT DEFINED ARG_VERSION_PATCHLEVEL)<br>
+ set(ARG_VERSION_PATCHLEVEL ${LLVM_VERSION_PATCH})<br>
+ endif()<br>
+<br>
+ if (NOT DEFINED ARG_VERSION_STRING)<br>
+ set(ARG_VERSION_STRING ${PACKAGE_VERSION})<br>
+ endif()<br>
+<br>
+ if (NOT DEFINED ARG_PRODUCT_NAME)<br>
+ set(ARG_PRODUCT_NAME "LLVM")<br>
+ endif()<br>
+<br>
+ get_target_property(target_location ${name} LOCATION)<br>
+ get_filename_component(target_filename ${target_location} NAME)<br>
+<br>
+ set_property(SOURCE ${resource_file}<br>
+ PROPERTY COMPILE_DEFINITIONS<br>
+ "RC_VERSION_FIELD_1=${ARG_VERSION_MAJOR}"<br>
+ "RC_VERSION_FIELD_2=${ARG_VERSION_MINOR}"<br>
+ "RC_VERSION_FIELD_3=${ARG_VERSION_PATCHLEVEL}"<br>
+ "RC_VERSION_FIELD_4=0"<br>
+ "RC_FILE_VERSION=\"${ARG_VERSION_STRING}\""<br>
+ "RC_INTERNAL_NAME=\"${name}\""<br>
+ "RC_ORIGINAL_FILENAME=\"${target_filename}\""<br>
+ "RC_PRODUCT_NAME=\"${ARG_PRODUCT_NAME}\""<br>
+ "RC_PRODUCT_VERSION=\"${ARG_VERSION_STRING}\"")<br>
+endfunction(set_windows_version_resource_properties)<br>
+<br>
# llvm_add_library(name sources...<br>
# SHARED;STATIC<br>
# STATIC by default w/o BUILD_SHARED_LIBS.<br>
@@ -316,10 +388,17 @@ function(llvm_add_library name)<br>
if(ARG_MODULE)<br>
add_library(${name} MODULE ${ALL_FILES})<br>
elseif(ARG_SHARED)<br>
+ add_windows_version_resource_file(ALL_FILES ${ALL_FILES})<br>
add_library(${name} SHARED ${ALL_FILES})<br>
else()<br>
add_library(${name} STATIC ${ALL_FILES})<br>
endif()<br>
+<br>
+ if(DEFINED windows_resource_file)<br>
+ set_windows_version_resource_properties(${name} ${windows_resource_file})<br>
+ set(windows_resource_file ${windows_resource_file} PARENT_SCOPE)<br>
+ endif()<br>
+<br>
set_output_directory(${name} ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})<br>
llvm_update_compile_flags(${name})<br>
add_link_opts( ${name} )<br>
@@ -482,11 +561,18 @@ endmacro(add_llvm_loadable_module name)<br>
<br>
macro(add_llvm_executable name)<br>
llvm_process_sources( ALL_FILES ${ARGN} )<br>
+ add_windows_version_resource_file(ALL_FILES ${ALL_FILES})<br>
+<br>
if( EXCLUDE_FROM_ALL )<br>
add_executable(${name} EXCLUDE_FROM_ALL ${ALL_FILES})<br>
else()<br>
add_executable(${name} ${ALL_FILES})<br>
endif()<br>
+<br>
+ if(DEFINED windows_resource_file)<br>
+ set_windows_version_resource_properties(${name} ${windows_resource_file})<br>
+ endif()<br>
+<br>
llvm_update_compile_flags(${name})<br>
add_link_opts( ${name} )<br>
<br>
<br>
Added: llvm/trunk/resources/windows_version_resource.rc<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_resources_windows-5Fversion-5Fresource.rc-3Frev-3D238740-26view-3Dauto&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=x7204Rz3acR6e5YRnrBhSkpTmUe07Ro1RVEQ3nSkfXI&s=ENxMYDbAqAXkq_ob0KEyoHHsB9lxTF7jyD0rPiDrHs0&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/resources/windows_version_resource.rc?rev=238740&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/resources/windows_version_resource.rc (added)<br>
+++ llvm/trunk/resources/windows_version_resource.rc Mon Jun 1 07:41:55 2015<br>
@@ -0,0 +1,89 @@<br>
+// Microsoft Visual C++ resource script for embedding version information.<br>
+// The format is described at:<br>
+// <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__msdn.microsoft.com_en-2Dgb_library_windows_desktop_aa380599-28v-3Dvs.85-29.aspx&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=x7204Rz3acR6e5YRnrBhSkpTmUe07Ro1RVEQ3nSkfXI&s=PKcPSBAtppeWOfjX7cT4Zvcb5WXJvd5jV10rvjDEkdA&e=" target="_blank">http://msdn.microsoft.com/en-gb/library/windows/desktop/aa380599(v=vs.85).aspx</a><br>
+// The VERSIONINFO resource is described at:<br>
+// <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dgb_library_windows_desktop_aa381058-28v-3Dvs.85-29.aspx&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=x7204Rz3acR6e5YRnrBhSkpTmUe07Ro1RVEQ3nSkfXI&s=jSbttDSJSR_6vWcsYUU2VEZQyh6eSBGAbKSmnI_7VSk&e=" target="_blank">https://msdn.microsoft.com/en-gb/library/windows/desktop/aa381058(v=vs.85).aspx</a><br>
+<br>
+<br>
+// Default values for required fields.<br>
+<br>
+#ifndef RC_VERSION_FIELD_1<br>
+#define RC_VERSION_FIELD_1 0<br>
+#endif<br>
+<br>
+#ifndef RC_VERSION_FIELD_2<br>
+#define RC_VERSION_FIELD_2 0<br>
+#endif<br>
+<br>
+#ifndef RC_VERSION_FIELD_3<br>
+#define RC_VERSION_FIELD_3 0<br>
+#endif<br>
+<br>
+#ifndef RC_VERSION_FIELD_4<br>
+#define RC_VERSION_FIELD_4 0<br>
+#endif<br>
+<br>
+#ifndef RC_COMPANY_NAME<br>
+#define RC_COMPANY_NAME ""<br>
+#endif<br>
+<br>
+#ifndef RC_FILE_DESCRIPTION<br>
+#define RC_FILE_DESCRIPTION ""<br>
+#endif<br>
+<br>
+#ifndef RC_FILE_VERSION<br>
+#define RC_FILE_VERSION ""<br>
+#endif<br>
+<br>
+#ifndef RC_INTERNAL_NAME<br>
+#define RC_INTERNAL_NAME ""<br>
+#endif<br>
+<br>
+#ifndef RC_ORIGINAL_FILENAME<br>
+#define RC_ORIGINAL_FILENAME ""<br>
+#endif<br>
+<br>
+#ifndef RC_PRODUCT_NAME<br>
+#define RC_PRODUCT_NAME ""<br>
+#endif<br>
+<br>
+#ifndef RC_PRODUCT_VERSION<br>
+#define RC_PRODUCT_VERSION ""<br>
+#endif<br>
+<br>
+<br>
+1 VERSIONINFO<br>
+FILEVERSION RC_VERSION_FIELD_1,RC_VERSION_FIELD_2,RC_VERSION_FIELD_3,RC_VERSION_FIELD_4<br>
+BEGIN<br>
+ BLOCK "StringFileInfo"<br>
+ BEGIN<br>
+ BLOCK "040904B0"<br>
+ BEGIN<br>
+ // Required strings<br>
+ VALUE "CompanyName", RC_COMPANY_NAME<br>
+ VALUE "FileDescription", RC_FILE_DESCRIPTION<br>
+ VALUE "FileVersion", RC_FILE_VERSION<br>
+ VALUE "InternalName", RC_INTERNAL_NAME<br>
+ VALUE "OriginalFilename", RC_ORIGINAL_FILENAME<br>
+ VALUE "ProductName", RC_PRODUCT_NAME<br>
+ VALUE "ProductVersion", RC_PRODUCT_VERSION<br>
+<br>
+ // Optional strings<br>
+#ifdef RC_COMMENTS<br>
+ VALUE "Comments", RC_COMMENTS<br>
+#endif<br>
+<br>
+#ifdef RC_COPYRIGHT<br>
+ VALUE "LegalCopyright", RC_COPYRIGHT<br>
+#endif<br>
+ END<br>
+ END<br>
+<br>
+ BLOCK "VarFileInfo"<br>
+ BEGIN<br>
+ // The translation must correspond to the above BLOCK inside StringFileInfo<br>
+ // langID 0x0409 U.S. English<br>
+ // charsetID 0x04B0 Unicode<br>
+ VALUE "Translation", 0x0409, 0x04B0<br>
+ END<br>
+END<br>
\ No newline at end of file<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">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>
</div></div><br>_______________________________________________<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>
<br></blockquote></div><br></div></div>