aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-config
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2009-01-07 19:24:44 +0000
committerOscar Fuentes <ofv@wanadoo.es>2009-01-07 19:24:44 +0000
commit82447ebb41c787fbfa01c08fece50b252b23bd07 (patch)
treebc64642c8e1947dfdf19be9d6ed4c6bc3efdc5aa /tools/llvm-config
parentacf984417fbb721467205011b5ef8f3595771df7 (diff)
CMake: replace `rm' with portable invocations of cmake.
Based on a bug report by Yonggang Luo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61875 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r--tools/llvm-config/CMakeLists.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
index 3f30603419..00bfe2390d 100644
--- a/tools/llvm-config/CMakeLists.txt
+++ b/tools/llvm-config/CMakeLists.txt
@@ -54,7 +54,7 @@ configure_file(
set(LIBDEPS ${CMAKE_CURRENT_BINARY_DIR}/LibDeps.txt)
set(LIBDEPS_TMP ${CMAKE_CURRENT_BINARY_DIR}/LibDeps.txt.tmp)
set(FINAL_LIBDEPS ${CMAKE_CURRENT_BINARY_DIR}/FinalLibDeps.txt)
-set(LLVM_CONFIG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/llvm-config)
+set(LLVM_CONFIG ${LLVM_TOOLS_BINARY_DIR}/llvm-config)
set(LLVM_CONFIG_IN ${CMAKE_CURRENT_BINARY_DIR}/llvm-config.in)
if( CMAKE_CROSSCOMPILING )
@@ -78,7 +78,7 @@ add_custom_command(OUTPUT ${LIBDEPS}
COMMENT "Updated ${LIBDEPS} because dependencies changed")
add_custom_command(OUTPUT ${FINAL_LIBDEPS}
- COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find-cycles.pl < ${LIBDEPS} > ${FINAL_LIBDEPS} || rm -f ${FINAL_LIBDEPS}
+ COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find-cycles.pl < ${LIBDEPS} > ${FINAL_LIBDEPS} || ${CMAKE_COMMAND} -E remove -f ${FINAL_LIBDEPS}
DEPENDS ${LIBDEPS}
COMMENT "Checking for cyclic dependencies between LLVM libraries.")
@@ -91,10 +91,10 @@ add_custom_command(OUTPUT ${LLVM_CONFIG}
COMMAND echo 's,@LIBS@,,' >> temp.sed # TODO: System libs
COMMAND echo 's,@LLVM_BUILDMODE@,${CMAKE_BUILD_TYPE},' >> temp.sed
COMMAND sed -f temp.sed < ${LLVM_CONFIG_IN} > ${LLVM_CONFIG}
- COMMAND rm temp.sed
+ COMMAND ${CMAKE_COMMAND} -E remove -f temp.sed
COMMAND cat ${FINAL_LIBDEPS} >> ${LLVM_CONFIG}
COMMAND chmod +x ${LLVM_CONFIG}
- COMMAND cd ${CMAKE_BINARY_DIR} && ${CMAKE_COMMAND} -U HAVE_LLVM_CONFIG ${CMAKE_SOURCE_DIR}
+ COMMAND cd ${CMAKE_BINARY_DIR} && ${CMAKE_COMMAND} -U HAVE_LLVM_CONFIG -D LLVM_BINARY_DIR="${LLVM_BINARY_DIR}" ${CMAKE_SOURCE_DIR}
DEPENDS ${FINAL_LIBDEPS} ${LLVM_CONFIG_IN}
COMMENT "Building llvm-config script."
)