1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Make llvm-config.in configuration more MSYS-friendly.

Some of those POSIX <-> Windows command line conversions ended on
failure.

llvm-svn: 127958
This commit is contained in:
Oscar Fuentes 2011-03-19 22:52:33 +00:00
parent 94b5de9966
commit 8419f80e50

View File

@ -55,9 +55,9 @@ configure_file(
@ONLY
)
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(LIBDEPS LibDeps.txt)
set(LIBDEPS_TMP LibDeps.txt.tmp)
set(FINAL_LIBDEPS FinalLibDeps.txt)
set(LLVM_CONFIG ${LLVM_TOOLS_BINARY_DIR}/llvm-config)
set(LLVM_CONFIG_IN ${CMAKE_CURRENT_BINARY_DIR}/llvm-config.in)
@ -107,17 +107,18 @@ remove_option_from_llvm_config("-Wall")
remove_option_from_llvm_config("-W")
add_custom_command(OUTPUT ${LLVM_CONFIG}
COMMAND echo 's!@LLVM_CPPFLAGS@!${CPP_FLGS}!' > temp.sed
COMMAND echo 's!@LLVM_CFLAGS@!${C_FLGS}!' >> temp.sed
COMMAND echo 's!@LLVM_CXXFLAGS@!${CXX_FLGS}!' >> temp.sed
COMMAND echo s!@LLVM_CPPFLAGS@!${CPP_FLGS}! > temp.sed
COMMAND echo s!@LLVM_CFLAGS@!${C_FLGS}! >> temp.sed
COMMAND echo s!@LLVM_CXXFLAGS@!${CXX_FLGS}! >> temp.sed
# TODO: Use general flags for linking! not just for shared libs:
COMMAND echo 's!@LLVM_LDFLAGS@!${CMAKE_SHARED_LINKER_FLAGS}!' >> temp.sed
COMMAND echo 's!@LIBS@!${LLVM_SYSTEM_LIBS}!' >> temp.sed
COMMAND echo 's!@LLVM_BUILDMODE@!${CMAKE_BUILD_TYPE}!' >> temp.sed
COMMAND echo s!@LLVM_LDFLAGS@!${CMAKE_SHARED_LINKER_FLAGS}! >> temp.sed
COMMAND echo s!@LIBS@!${LLVM_SYSTEM_LIBS}! >> temp.sed
COMMAND echo s!@LLVM_BUILDMODE@!${CMAKE_BUILD_TYPE}! >> temp.sed
COMMAND sed -f temp.sed < ${LLVM_CONFIG_IN} > ${LLVM_CONFIG}
COMMAND ${CMAKE_COMMAND} -E remove -f temp.sed
COMMAND cat ${FINAL_LIBDEPS} >> ${LLVM_CONFIG}
COMMAND chmod +x ${LLVM_CONFIG}
VERBATIM
DEPENDS ${FINAL_LIBDEPS} ${LLVM_CONFIG_IN}
COMMENT "Building llvm-config script."
)