[llvm] r200311 - [CMake] llvm_update_compile_flags(name) doesn't require source files. TARGET PROPERTY SOURCES has them.
NAKAMURA Takumi
geek4civic at gmail.com
Tue Jan 28 03:40:04 PST 2014
Author: chapuni
Date: Tue Jan 28 05:40:04 2014
New Revision: 200311
URL: http://llvm.org/viewvc/llvm-project?rev=200311&view=rev
Log:
[CMake] llvm_update_compile_flags(name) doesn't require source files. TARGET PROPERTY SOURCES has them.
Modified:
llvm/trunk/cmake/modules/AddLLVM.cmake
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=200311&r1=200310&r2=200311&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Tue Jan 28 05:40:04 2014
@@ -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)
More information about the llvm-commits
mailing list