forked from OSchip/llvm-project
[CMake] llvm_update_compile_flags(name) doesn't require source files. TARGET PROPERTY SOURCES has them.
llvm-svn: 200311
This commit is contained in:
parent
d8d490ed50
commit
b524c2227e
|
@ -3,8 +3,8 @@ include(LLVMProcessSources)
|
||||||
include(LLVM-Config)
|
include(LLVM-Config)
|
||||||
|
|
||||||
function(llvm_update_compile_flags name)
|
function(llvm_update_compile_flags name)
|
||||||
set(ALL_SOURCES ${ARGN})
|
get_property(sources TARGET ${name} PROPERTY SOURCES)
|
||||||
if("${ALL_SOURCES}" MATCHES "\\.c(;|$)")
|
if("${sources}" MATCHES "\\.c(;|$)")
|
||||||
set(update_src_props ON)
|
set(update_src_props ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ function(llvm_update_compile_flags name)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(update_src_props)
|
if(update_src_props)
|
||||||
foreach(fn ${ALL_SOURCES})
|
foreach(fn ${sources})
|
||||||
get_filename_component(suf ${fn} EXT)
|
get_filename_component(suf ${fn} EXT)
|
||||||
if("${suf}" STREQUAL ".cpp")
|
if("${suf}" STREQUAL ".cpp")
|
||||||
set_property(SOURCE ${fn} APPEND_STRING PROPERTY
|
set_property(SOURCE ${fn} APPEND_STRING PROPERTY
|
||||||
|
@ -162,7 +162,7 @@ macro(add_llvm_library name)
|
||||||
add_library( ${name} ${ALL_FILES} )
|
add_library( ${name} ${ALL_FILES} )
|
||||||
set_output_directory(${name} ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
|
set_output_directory(${name} ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
|
||||||
set_property( GLOBAL APPEND PROPERTY LLVM_LIBS ${name} )
|
set_property( GLOBAL APPEND PROPERTY LLVM_LIBS ${name} )
|
||||||
llvm_update_compile_flags(${name} ${ALL_FILES})
|
llvm_update_compile_flags(${name})
|
||||||
add_dead_strip( ${name} )
|
add_dead_strip( ${name} )
|
||||||
if( LLVM_COMMON_DEPENDS )
|
if( LLVM_COMMON_DEPENDS )
|
||||||
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
|
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
|
||||||
|
@ -222,7 +222,7 @@ ${name} ignored.")
|
||||||
add_library( ${name} ${libkind} ${ALL_FILES} )
|
add_library( ${name} ${libkind} ${ALL_FILES} )
|
||||||
set_output_directory(${name} ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
|
set_output_directory(${name} ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
|
||||||
set_target_properties( ${name} PROPERTIES PREFIX "" )
|
set_target_properties( ${name} PROPERTIES PREFIX "" )
|
||||||
llvm_update_compile_flags(${name} ${ALL_FILES})
|
llvm_update_compile_flags(${name})
|
||||||
add_dead_strip( ${name} )
|
add_dead_strip( ${name} )
|
||||||
|
|
||||||
if (LLVM_EXPORTED_SYMBOL_FILE)
|
if (LLVM_EXPORTED_SYMBOL_FILE)
|
||||||
|
@ -264,7 +264,7 @@ macro(add_llvm_executable name)
|
||||||
else()
|
else()
|
||||||
add_executable(${name} ${ALL_FILES})
|
add_executable(${name} ${ALL_FILES})
|
||||||
endif()
|
endif()
|
||||||
llvm_update_compile_flags(${name} ${ALL_FILES})
|
llvm_update_compile_flags(${name})
|
||||||
add_dead_strip( ${name} )
|
add_dead_strip( ${name} )
|
||||||
|
|
||||||
if (LLVM_EXPORTED_SYMBOL_FILE)
|
if (LLVM_EXPORTED_SYMBOL_FILE)
|
||||||
|
|
Loading…
Reference in New Issue