Use Darwin libtool's -no_warning_for_no_symbols if available to silence the "has...
authorKuba Mracek <mracek@apple.com>
Mon, 5 Dec 2016 05:21:44 +0000 (05:21 +0000)
committerKuba Mracek <mracek@apple.com>
Mon, 5 Dec 2016 05:21:44 +0000 (05:21 +0000)
commitfde4a454efb5b6766b479fa5607945846ac714ef
tree54db49e4ceec214ee52736daa9893d8869854c08
parent6e074de48eb22c791ed8827e4e44eddeee18abe0
Use Darwin libtool's -no_warning_for_no_symbols if available to silence the "has no symbols" link warning

Building compiler-rt on Darwin produces dozens of meaningless warnings about object files having no symbols during static archive creation. This is very intentional as compiler-rt uses #ifdefs to conditionally compile platform-specific code, and we even have a .cpp source file that only contains static asserts to make sure the environment is configured right. On Linux, this situation is fine and no warning is produced. This patch adds a libtool version detection and if it's new enough, we'll use the -no_warning_for_no_symbols flag that suppresses this warning. Build logs should be much cleaner now!

Differential Revision: https://reviews.llvm.org/D27119

llvm-svn: 288640
llvm/CMakeLists.txt