1set(LLVM_LINK_COMPONENTS support) 2 3set(BUILDVARIABLES_SRCPATH ${CMAKE_CURRENT_SOURCE_DIR}/BuildVariables.inc.in) 4set(BUILDVARIABLES_OBJPATH ${CMAKE_CURRENT_BINARY_DIR}/BuildVariables.inc) 5 6# Compute the substitution values for various items. 7get_property(LLVM_SYSTEM_LIBS_LIST TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) 8foreach(l ${LLVM_SYSTEM_LIBS_LIST}) 9 set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}") 10endforeach() 11string(REPLACE ";" " " SYSTEM_LIBS "${SYSTEM_LIBS}") 12 13# Use configure_file to create BuildVariables.inc. 14set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR}) 15set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR}) 16set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") 17set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") 18set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") 19# Use the C++ link flags, since they should be a superset of C link flags. 20set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}") 21set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE}) 22set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS}) 23string(REPLACE ";" " " LLVM_TARGETS_BUILT "${LLVM_TARGETS_TO_BUILD}") 24configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY) 25 26# Set build-time environment(s). 27add_definitions(-DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}") 28 29# Add the llvm-config tool. 30add_llvm_tool(llvm-config 31 llvm-config.cpp 32 ) 33 34# Add the dependency on the generation step. 35add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH}) 36