aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-config
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2009-05-27 15:49:33 +0000
committerOscar Fuentes <ofv@wanadoo.es>2009-05-27 15:49:33 +0000
commit1a53cbfb4a532511633ad752fcf7396a79857e98 (patch)
tree38f7a3cad6ac8c3eed2a48fcc576a1406ba88295 /tools/llvm-config
parentb5da3f6f98b28afc0c62572c164ffccb4004827f (diff)
CMake: Set LIBS on llvm-config so we can query the system libraries
used by CMake with --ldflags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72470 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r--tools/llvm-config/CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
index 4fb208b500..29287ab82b 100644
--- a/tools/llvm-config/CMakeLists.txt
+++ b/tools/llvm-config/CMakeLists.txt
@@ -28,6 +28,11 @@ set(SHLIBEXT ${LTDL_SHLIB_EXT})
set(OS "${CMAKE_SYSTEM}")
set(ARCH "X86") # TODO: This gives "i686" in Linux: "${CMAKE_SYSTEM_PROCESSOR}")
+get_system_libs(LLVM_SYSTEM_LIBS_LIST)
+foreach(l ${LLVM_SYSTEM_LIBS_LIST})
+ set(LLVM_SYSTEM_LIBS ${LLVM_SYSTEM_LIBS} "-l${l}")
+endforeach()
+
include(GetTargetTriple)
get_target_triple(target)
@@ -93,7 +98,7 @@ add_custom_command(OUTPUT ${LLVM_CONFIG}
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@!!' >> temp.sed # TODO: System libs
+ 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