From c4ffd48aba663ea3dfd5bf60fab9affcf5b081be Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Tue, 28 Jul 2015 16:52:42 +0000 Subject: [PATCH] Let cmake infer source file language by the file extension. This applies default compiler flags to .S files, in particular removing the "-pedantic" option, which is desirable because there is nothing to reasonably warn about; and the only thing that gcc warns about is that you allegedly can't correctly invoke GLUE2 in lib/builtins/assembly.h on platforms for which USER_LABEL_PREFIX is the empty string. In the gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33305 that added the warning, a commenter notes that giving a macro of zero characters to another macro is not precisely the same as failing to supply an argument, and "there is a widespread belief in C++ community that such usage is valid". Unfortunately the only way to silence the warning is to avoid -pedantic. Differential Revision: http://reviews.llvm.org/D10713 llvm-svn: 243446 --- compiler-rt/CMakeLists.txt | 2 +- compiler-rt/lib/builtins/CMakeLists.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index c65719d72e78..6367cd8f86ab 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -9,7 +9,7 @@ # Check if compiler-rt is built as a standalone project. if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - project(CompilerRT C CXX) + project(CompilerRT C CXX ASM) set(COMPILER_RT_STANDALONE_BUILD TRUE) else() set(COMPILER_RT_STANDALONE_BUILD FALSE) diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index 98d518a83e2c..b7a92b1d5a09 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -286,7 +286,6 @@ if (NOT WIN32 OR MINGW) endif () endforeach () - set_source_files_properties(${${arch}_SOURCES} PROPERTIES LANGUAGE C) add_compiler_rt_runtime(clang_rt.builtins-${arch} ${arch} STATIC SOURCES ${${arch}_SOURCES} CFLAGS "-std=c99")