From 510c731153e2938874217ebaa4d9b5c8a5985c00 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Tue, 28 Jan 2014 11:40:04 +0000 Subject: [PATCH] [CMake] llvm_update_compile_flags(name) doesn't require source files. TARGET PROPERTY SOURCES has them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200311 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/AddLLVM.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 6996c388b3e..19a68387fee 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -3,8 +3,8 @@ include(LLVMProcessSources) include(LLVM-Config) function(llvm_update_compile_flags name) - set(ALL_SOURCES ${ARGN}) - if("${ALL_SOURCES}" MATCHES "\\.c(;|$)") + get_property(sources TARGET ${name} PROPERTY SOURCES) + if("${sources}" MATCHES "\\.c(;|$)") set(update_src_props ON) endif() @@ -29,7 +29,7 @@ function(llvm_update_compile_flags name) endif() if(update_src_props) - foreach(fn ${ALL_SOURCES}) + foreach(fn ${sources}) get_filename_component(suf ${fn} EXT) if("${suf}" STREQUAL ".cpp") set_property(SOURCE ${fn} APPEND_STRING PROPERTY @@ -162,7 +162,7 @@ macro(add_llvm_library name) add_library( ${name} ${ALL_FILES} ) set_output_directory(${name} ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR}) set_property( GLOBAL APPEND PROPERTY LLVM_LIBS ${name} ) - llvm_update_compile_flags(${name} ${ALL_FILES}) + llvm_update_compile_flags(${name}) add_dead_strip( ${name} ) if( LLVM_COMMON_DEPENDS ) add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} ) @@ -222,7 +222,7 @@ ${name} ignored.") add_library( ${name} ${libkind} ${ALL_FILES} ) set_output_directory(${name} ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR}) set_target_properties( ${name} PROPERTIES PREFIX "" ) - llvm_update_compile_flags(${name} ${ALL_FILES}) + llvm_update_compile_flags(${name}) add_dead_strip( ${name} ) if (LLVM_EXPORTED_SYMBOL_FILE) @@ -264,7 +264,7 @@ macro(add_llvm_executable name) else() add_executable(${name} ${ALL_FILES}) endif() - llvm_update_compile_flags(${name} ${ALL_FILES}) + llvm_update_compile_flags(${name}) add_dead_strip( ${name} ) if (LLVM_EXPORTED_SYMBOL_FILE) -- 2.34.1