llvm.org GIT mirror llvm / 82447eb
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 Oscar Fuentes 10 years ago
2 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
2929 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib
3030 COMMAND ar x ${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}
3131 COMMAND ${CMAKE_LINKER} "${LLVM_PLO_FLAGS}" -r "*${CMAKE_CXX_OUTPUT_EXTENSION}" -o ${pll}
32 COMMAND rm -f *${CMAKE_CXX_OUTPUT_EXTENSION}
32 COMMAND ${CMAKE_COMMAND} -E remove -f *${CMAKE_CXX_OUTPUT_EXTENSION}
3333 )
3434 target_name_of_partially_linked_object(${lib} tnplo)
3535 add_custom_target(${tnplo} ALL DEPENDS ${pll})
5353 set(LIBDEPS ${CMAKE_CURRENT_BINARY_DIR}/LibDeps.txt)
5454 set(LIBDEPS_TMP ${CMAKE_CURRENT_BINARY_DIR}/LibDeps.txt.tmp)
5555 set(FINAL_LIBDEPS ${CMAKE_CURRENT_BINARY_DIR}/FinalLibDeps.txt)
56 set(LLVM_CONFIG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/llvm-config)
56 set(LLVM_CONFIG ${LLVM_TOOLS_BINARY_DIR}/llvm-config)
5757 set(LLVM_CONFIG_IN ${CMAKE_CURRENT_BINARY_DIR}/llvm-config.in)
5858
5959 if( CMAKE_CROSSCOMPILING )
7777 COMMENT "Updated ${LIBDEPS} because dependencies changed")
7878
7979 add_custom_command(OUTPUT ${FINAL_LIBDEPS}
80 COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find-cycles.pl < ${LIBDEPS} > ${FINAL_LIBDEPS} || rm -f ${FINAL_LIBDEPS}
80 COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find-cycles.pl < ${LIBDEPS} > ${FINAL_LIBDEPS} || ${CMAKE_COMMAND} -E remove -f ${FINAL_LIBDEPS}
8181 DEPENDS ${LIBDEPS}
8282 COMMENT "Checking for cyclic dependencies between LLVM libraries.")
8383
9090 COMMAND echo 's,@LIBS@,,' >> temp.sed # TODO: System libs
9191 COMMAND echo 's,@LLVM_BUILDMODE@,${CMAKE_BUILD_TYPE},' >> temp.sed
9292 COMMAND sed -f temp.sed < ${LLVM_CONFIG_IN} > ${LLVM_CONFIG}
93 COMMAND rm temp.sed
93 COMMAND ${CMAKE_COMMAND} -E remove -f temp.sed
9494 COMMAND cat ${FINAL_LIBDEPS} >> ${LLVM_CONFIG}
9595 COMMAND chmod +x ${LLVM_CONFIG}
96 COMMAND cd ${CMAKE_BINARY_DIR} && ${CMAKE_COMMAND} -U HAVE_LLVM_CONFIG ${CMAKE_SOURCE_DIR}
96 COMMAND cd ${CMAKE_BINARY_DIR} && ${CMAKE_COMMAND} -U HAVE_LLVM_CONFIG -D LLVM_BINARY_DIR="${LLVM_BINARY_DIR}" ${CMAKE_SOURCE_DIR}
9797 DEPENDS ${FINAL_LIBDEPS} ${LLVM_CONFIG_IN}
9898 COMMENT "Building llvm-config script."
9999 )