Russell Wallace
2015-Feb-01 16:39 UTC
[LLVMdev] Building LLVM with static linking on Windows
I'm trying to build LLVM 3.5.1 on Windows, almost successfully; the remaining stumbling block is getting static linking for release builds. The problem is that the .vcxproj is interpreted by msbuild to compile with the /MD option instead of /MT, as detailed in: https://stackoverflow.com/questions/28262372/getting-msbuild-to-use-mt-staticrelease Haven't got any answers on that question, and discussion in: https://social.msdn.microsoft.com/Forums/vstudio/en-US/1a6dd13c-9f5c-430b-88ba-518bfcca00b1/how-to-set-the-runtime-library-to-mt-on-command-line-with-msbuild?forum=vcgeneral suggests msbuild isn't even capable of such. What's the best way to get a static release build? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150201/96afd4df/attachment.html>
You need to cmake with -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT for static linking with Debug and Release configurations reprectively. Yaron 2015-02-01 18:39 GMT+02:00 Russell Wallace <russell.wallace at gmail.com>:> I'm trying to build LLVM 3.5.1 on Windows, almost successfully; the > remaining stumbling block is getting static linking for release builds. The > problem is that the .vcxproj is interpreted by msbuild to compile with the > /MD option instead of /MT, as detailed in: > > > https://stackoverflow.com/questions/28262372/getting-msbuild-to-use-mt-staticrelease > > Haven't got any answers on that question, and discussion in: > > > https://social.msdn.microsoft.com/Forums/vstudio/en-US/1a6dd13c-9f5c-430b-88ba-518bfcca00b1/how-to-set-the-runtime-library-to-mt-on-command-line-with-msbuild?forum=vcgeneral > > suggests msbuild isn't even capable of such. > > What's the best way to get a static release build? > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150201/acd7bdbe/attachment.html>
Russell Wallace
2015-Feb-02 05:17 UTC
[LLVMdev] Building LLVM with static linking on Windows
That works, thanks! On Sun, Feb 1, 2015 at 5:11 PM, Yaron Keren <yaron.keren at gmail.com> wrote:> You need to cmake with > > -DLLVM_USE_CRT_DEBUG=MTd > -DLLVM_USE_CRT_RELEASE=MT > > for static linking with Debug and Release configurations reprectively. > > Yaron > > > 2015-02-01 18:39 GMT+02:00 Russell Wallace <russell.wallace at gmail.com>: > >> I'm trying to build LLVM 3.5.1 on Windows, almost successfully; the >> remaining stumbling block is getting static linking for release builds. The >> problem is that the .vcxproj is interpreted by msbuild to compile with the >> /MD option instead of /MT, as detailed in: >> >> >> https://stackoverflow.com/questions/28262372/getting-msbuild-to-use-mt-staticrelease >> >> Haven't got any answers on that question, and discussion in: >> >> >> https://social.msdn.microsoft.com/Forums/vstudio/en-US/1a6dd13c-9f5c-430b-88ba-518bfcca00b1/how-to-set-the-runtime-library-to-mt-on-command-line-with-msbuild?forum=vcgeneral >> >> suggests msbuild isn't even capable of such. >> >> What's the best way to get a static release build? >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150202/51dc18aa/attachment.html>