[PATCH] D16153: tools/CMakeLists: Use a macro for common code, fix custom_command output
Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 19 19:23:55 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL258280: tools/CMakeLists: Use a macro for common code, fix custom_command output (authored by matze).
Changed prior to commit:
http://reviews.llvm.org/D16153?vs=44783&id=45337#toc
Repository:
rL LLVM
http://reviews.llvm.org/D16153
Files:
test-suite/trunk/tools/CMakeLists.txt
Index: test-suite/trunk/tools/CMakeLists.txt
===================================================================
--- test-suite/trunk/tools/CMakeLists.txt
+++ test-suite/trunk/tools/CMakeLists.txt
@@ -9,15 +9,14 @@
set(TEST_SUITE_HOST_CC "cc" CACHE STRING "C compiler targetting the host")
mark_as_advanced(TEST_SUITE_HOST_CC)
-add_custom_target(fpcmp-host
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fpcmp)
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fpcmp
- COMMAND ${TEST_SUITE_HOST_CC} ${CMAKE_CURRENT_SOURCE_DIR}/fpcmp.c -o ${CMAKE_CURRENT_BINARY_DIR}/fpcmp
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/fpcmp.c
-)
-add_custom_target(timeit-host
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/timeit)
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/timeit
- COMMAND ${TEST_SUITE_HOST_CC} ${CMAKE_CURRENT_SOURCE_DIR}/timeit.c -o ${CMAKE_CURRENT_BINARY_DIR}/timeit
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/timeit.c
-)
+macro(llvm_add_host_executable targetname exename sourcefile)
+ add_custom_command(OUTPUT ${exename}
+ COMMAND ${TEST_SUITE_HOST_CC} ${CMAKE_CURRENT_SOURCE_DIR}/${sourcefile} -o ${CMAKE_CURRENT_BINARY_DIR}/${exename}
+ COMMENT "[TEST_SUITE_HOST_CC] Building host executable ${exename}"
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${sourcefile}
+ )
+ add_custom_target(${targetname} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${exename})
+endmacro()
+
+llvm_add_host_executable(fpcmp-host fpcmp fpcmp.c)
+llvm_add_host_executable(timeit-host timeit timeit.c)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16153.45337.patch
Type: text/x-patch
Size: 1485 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160120/e3ce4d95/attachment.bin>
More information about the llvm-commits
mailing list