From 82447ebb41c787fbfa01c08fece50b252b23bd07 Mon Sep 17 00:00:00 2001 From: Oscar Fuentes Date: Wed, 7 Jan 2009 19:24:44 +0000 Subject: [PATCH] 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 --- cmake/modules/AddPartiallyLinkedObject.cmake | 2 +- tools/llvm-config/CMakeLists.txt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/modules/AddPartiallyLinkedObject.cmake b/cmake/modules/AddPartiallyLinkedObject.cmake index e13574ba131..fd5069d6786 100755 --- a/cmake/modules/AddPartiallyLinkedObject.cmake +++ b/cmake/modules/AddPartiallyLinkedObject.cmake @@ -30,7 +30,7 @@ macro(add_partially_linked_object lib) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib COMMAND ar x ${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX} COMMAND ${CMAKE_LINKER} "${LLVM_PLO_FLAGS}" -r "*${CMAKE_CXX_OUTPUT_EXTENSION}" -o ${pll} - COMMAND rm -f *${CMAKE_CXX_OUTPUT_EXTENSION} + COMMAND ${CMAKE_COMMAND} -E remove -f *${CMAKE_CXX_OUTPUT_EXTENSION} ) target_name_of_partially_linked_object(${lib} tnplo) add_custom_target(${tnplo} ALL DEPENDS ${pll}) diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt index 3f306034198..00bfe2390de 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." )