[test-suite] r259909 - cmake: Simplify append_cflags()
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 5 11:30:09 PST 2016
Author: matze
Date: Fri Feb 5 13:30:08 2016
New Revision: 259909
URL: http://llvm.org/viewvc/llvm-project?rev=259909&view=rev
Log:
cmake: Simplify append_cflags()
Modified:
test-suite/trunk/cmake/modules/SingleMultiSource.cmake
Modified: test-suite/trunk/cmake/modules/SingleMultiSource.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/SingleMultiSource.cmake?rev=259909&r1=259908&r2=259909&view=diff
==============================================================================
--- test-suite/trunk/cmake/modules/SingleMultiSource.cmake (original)
+++ test-suite/trunk/cmake/modules/SingleMultiSource.cmake Fri Feb 5 13:30:08 2016
@@ -49,13 +49,13 @@ function(get_unique_exe_name new_name ma
endfunction()
# append_cflags - add flags to the CFLAGS for target.
-macro(append_cflags target flags)
- if(NOT "${${flags}}" STREQUAL "")
+macro(append_cflags target)
+ if(NOT "${ARGN}" STREQUAL "")
get_target_property(old_cflags ${target} COMPILE_FLAGS)
if(${old_cflags} STREQUAL "old_cflags-NOTFOUND")
set(old_cflags)
endif()
- string(REPLACE ";" " " s "${old_cflags};${${flags}}")
+ string(REPLACE ";" " " s "${old_cflags};${ARGN}")
set_target_properties(${target} PROPERTIES COMPILE_FLAGS ${s})
endif()
endmacro()
@@ -127,9 +127,9 @@ macro(test_suite_add_executable name mai
if(${name_idx} EQUAL -1)
get_unique_exe_name(source_exename ${mainsource})
add_executable(${source_exename} ${ARGN})
- append_cflags(${source_exename} CFLAGS)
- append_cflags(${source_exename} CPPFLAGS)
- append_cflags(${source_exename} CXXFLAGS)
+ append_cflags(${source_exename} ${CFLAGS})
+ append_cflags(${source_exename} ${CPPFLAGS})
+ append_cflags(${source_exename} ${CXXFLAGS})
target_link_libraries(${source_exename} ${LDFLAGS})
llvm_add_test(${name} ${source_exename})
add_dependencies(${source_exename} timeit-host timeit-target fpcmp-host)
More information about the llvm-commits
mailing list