[test-suite] r341256 - cmake: Copy HashProgramOutput.sh to build dir
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 31 14:06:25 PDT 2018
Author: matze
Date: Fri Aug 31 14:06:25 2018
New Revision: 341256
URL: http://llvm.org/viewvc/llvm-project?rev=341256&view=rev
Log:
cmake: Copy HashProgramOutput.sh to build dir
This avoids needing to reference the test-suite source directory when
running benchmarks.
Modified:
test-suite/trunk/cmake/modules/SingleMultiSource.cmake
test-suite/trunk/cmake/modules/TestSuite.cmake
test-suite/trunk/tools/CMakeLists.txt
Modified: test-suite/trunk/cmake/modules/SingleMultiSource.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/SingleMultiSource.cmake?rev=341256&r1=341255&r2=341256&view=diff
==============================================================================
--- test-suite/trunk/cmake/modules/SingleMultiSource.cmake (original)
+++ test-suite/trunk/cmake/modules/SingleMultiSource.cmake Fri Aug 31 14:06:25 2018
@@ -61,7 +61,7 @@ endfunction()
macro(llvm_test_verify_hash_program_output _file)
llvm_test_verify(WORKDIR ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/HashProgramOutput.sh ${_file}
+ ${CMAKE_BINARY_DIR}/tools/HashProgramOutput.sh ${_file}
)
endmacro()
Modified: test-suite/trunk/cmake/modules/TestSuite.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/TestSuite.cmake?rev=341256&r1=341255&r2=341256&view=diff
==============================================================================
--- test-suite/trunk/cmake/modules/TestSuite.cmake (original)
+++ test-suite/trunk/cmake/modules/TestSuite.cmake Fri Aug 31 14:06:25 2018
@@ -85,7 +85,12 @@ endfunction()
# usually do not need to call this directly when using `llvm_test_executable`
# or `llvm_test_library`.
function(test_suite_add_build_dependencies target)
- add_dependencies(${target} build-timeit build-timeit-target build-fpcmp)
+ add_dependencies(${target}
+ build-HashProgramOutput.sh
+ build-fpcmp
+ build-timeit
+ build-timeit-target
+ )
endfunction()
# Internal function that transforms a list of flags to a string and appends
Modified: test-suite/trunk/tools/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/tools/CMakeLists.txt?rev=341256&r1=341255&r2=341256&view=diff
==============================================================================
--- test-suite/trunk/tools/CMakeLists.txt (original)
+++ test-suite/trunk/tools/CMakeLists.txt Fri Aug 31 14:06:25 2018
@@ -1,12 +1,19 @@
# Note that we have to compile fpcmp and timeit for the host machine even when
-# cross compiling to a different target. We use custom rules doing "cc file.c"
-# as an ad-hoc solution for now. A proper solution would probably be based on
-# ExternalProject_Add(); See also http://reviews.llvm.org/D15004
+# cross compiling to a different target. We use custom rules doing a simple
+# "cc file.c".
include(Host)
llvm_add_host_executable(build-fpcmp fpcmp fpcmp.c)
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/HashProgramOutput.sh
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../HashProgramOutput.sh ${CMAKE_CURRENT_BINARY_DIR}/HashProgramOutput.sh
+ COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/HashProgramOutput.sh
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../HashProgramOutput.sh
+)
+add_custom_target(build-HashProgramOutput.sh DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/HashProgramOutput.sh)
+
option(TEST_SUITE_USE_PERF "Use perf (timeit.sh) instead of timeit.c" OFF)
if(TEST_SUITE_USE_PERF)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/timeit
More information about the llvm-commits
mailing list