2011-12-01 20:18:09 +00:00
|
|
|
set(LLVM_LINK_COMPONENTS support)
|
2008-09-22 01:08:49 +00:00
|
|
|
|
2011-12-01 20:18:09 +00:00
|
|
|
set(BUILDVARIABLES_SRCPATH ${CMAKE_CURRENT_SOURCE_DIR}/BuildVariables.inc.in)
|
|
|
|
set(BUILDVARIABLES_OBJPATH ${CMAKE_CURRENT_BINARY_DIR}/BuildVariables.inc)
|
2008-10-26 00:47:52 +00:00
|
|
|
|
2011-12-01 20:18:09 +00:00
|
|
|
# Compute the substitution values for various items.
|
2009-05-27 15:49:33 +00:00
|
|
|
get_system_libs(LLVM_SYSTEM_LIBS_LIST)
|
|
|
|
foreach(l ${LLVM_SYSTEM_LIBS_LIST})
|
2011-12-01 20:18:09 +00:00
|
|
|
set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}")
|
2009-05-27 15:49:33 +00:00
|
|
|
endforeach()
|
2009-04-04 22:41:07 +00:00
|
|
|
|
2013-08-23 17:59:13 +00:00
|
|
|
# Use configure_file to create BuildVariables.inc.
|
|
|
|
set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
|
|
|
|
set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
|
|
|
|
set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
|
|
|
|
set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
|
|
|
|
set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
|
|
|
|
set(LLVM_LDFLAGS ${CMAKE_SHARED_LINKER_FLAGS})
|
|
|
|
set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
|
|
|
|
set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
|
|
|
|
set(LLVM_TARGETS_BUILT ${LLVM_TARGETS_TO_BUILD})
|
|
|
|
configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY)
|
2008-09-22 01:08:49 +00:00
|
|
|
|
2011-12-01 20:18:09 +00:00
|
|
|
# Add the llvm-config tool.
|
|
|
|
add_llvm_tool(llvm-config
|
|
|
|
llvm-config.cpp
|
|
|
|
)
|
2011-11-02 17:22:57 +00:00
|
|
|
|
2011-12-01 20:18:09 +00:00
|
|
|
# Add the dependency on the generation step.
|
|
|
|
add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH})
|