OSDN Git Service

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)
commit9a1eeb20832cf434ed9b1082fdfaed8afd49fd90
treeb85bb2771a50687481e24d73b24739c5cf361fb2
parentc7fb36d42d489206bfd1a2cc7dd55b02e5e3dc9a
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288640 91177308-0d34-0410-b5e6-96231b3b80d8
CMakeLists.txt