[CMake] llvm_update_compile_flags(name) doesn't require source files. TARGET PROPERTY SOURCES has them.

llvm-svn: 200311
This commit is contained in:
NAKAMURA Takumi 2014-01-28 11:40:04 +00:00
parent d8d490ed50
commit b524c2227e
1 changed files with 6 additions and 6 deletions

View File

@ -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)