[test-suite] r309828 - TestSuite.cmake: Improve comments; NFC
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 2 08:58:45 PDT 2017
Author: matze
Date: Wed Aug 2 08:58:45 2017
New Revision: 309828
URL: http://llvm.org/viewvc/llvm-project?rev=309828&view=rev
Log:
TestSuite.cmake: Improve comments; NFC
Modified:
test-suite/trunk/cmake/modules/TestSuite.cmake
Modified: test-suite/trunk/cmake/modules/TestSuite.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/TestSuite.cmake?rev=309828&r1=309827&r2=309828&view=diff
==============================================================================
--- test-suite/trunk/cmake/modules/TestSuite.cmake (original)
+++ test-suite/trunk/cmake/modules/TestSuite.cmake Wed Aug 2 08:58:45 2017
@@ -5,9 +5,11 @@
##===----------------------------------------------------------------------===##
include(TestFile)
-# Creates a new executable build target, applies CFLAGS, CPPFLAGS, CXXFLAGS
-# and LDFLAGS. Creates a .test file if possible and registers the target
-# with the TEST_SUITE_TARGETS list.
+# Creates a new executable build target. Use this instead of `add_executable`.
+# It applies CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS. Creates a .test file if
+# necessary, registers the target with the TEST_SUITE_TARGETS list and makes
+# sure we build the required dependencies for compiletime measurements
+# and support the TEST_SUITE_PROFILE_USE mode.
macro(llvm_test_executable target)
add_executable(${target} ${ARGN})
append_target_flags(COMPILE_FLAGS ${target} ${CFLAGS})
@@ -27,8 +29,9 @@ macro(llvm_test_executable target)
test_suite_add_build_dependencies(${target})
endmacro()
-# Creates a new library build target, applies CFLAGS, CPPFLAGS, CXXFLAGS
-# and LDFLAGS.
+# Creates a new library build target. Use this instead of `add_library`.
+# Behaves like `llvm_test_executable`, just produces a library instead of an
+# executable.
macro(llvm_test_library target)
add_library(${target} ${ARGN})
@@ -44,6 +47,16 @@ macro(llvm_test_library target)
test_suite_add_build_dependencies(${target})
endmacro()
+# Add dependencies required for compiletime measurements to a target. You
+# usually do not need to call this directly when using `llvm_test_executable`
+# or `llvm_test_library`.
+macro(test_suite_add_build_dependencies target)
+ if(NOT TEST_SUITE_USE_PERF)
+ add_dependencies(${target} timeit-target)
+ endif()
+ add_dependencies(${target} timeit-host fpcmp-host)
+endmacro()
+
# Internal function that transforms a list of flags to a string and appends
# it to a given property of a target.
macro(append_target_flags propertyname target)
@@ -65,12 +78,3 @@ macro(append_target_flags propertyname t
set_target_properties(${target} PROPERTIES ${propertyname} "${new_flags}")
endif()
endmacro()
-
-# Internal function that adds the tools used for compiletime measurement as a
-# target.
-macro(test_suite_add_build_dependencies target)
- if(NOT TEST_SUITE_USE_PERF)
- add_dependencies(${target} timeit-target)
- endif()
- add_dependencies(${target} timeit-host fpcmp-host)
-endmacro()
More information about the llvm-commits
mailing list