Commit 0ea93300 authored by Akash Kothari's avatar Akash Kothari
Browse files

Add hpvm-config

parent 957c5a34
include_directories(./include/)
add_subdirectory(lib)
add_subdirectory(projects)
add_subdirectory(tools)
add_subdirectory(test)
......
......@@ -104,6 +104,7 @@ if [ ! -d $HPVM_DIR ]; then
ln -s $CURRENT_DIR/lib $HPVM_DIR/
ln -s $CURRENT_DIR/projects $HPVM_DIR/
ln -s $CURRENT_DIR/test $HPVM_DIR/
ln -s $CURRENT_DIR/tools $HPVM_DIR/
else
echo $CURRENT_DIR/$LLVM_SRC/tools/hpvm exists.
fi
......
add_llvm_tool_subdirectory(hpvm-config)
//===-- BuildVariables.inc.in - llvm-config build variables -*- C++ -*-----===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file is configured by the build system to define the variables
// llvm-config wants to report to the user, but which can only be determined at
// build time.
//
// The variant of this file not ending with .in has been autogenerated by the
// LLVM build. Do not edit!
//
//===----------------------------------------------------------------------===//
#define LLVM_SRC_ROOT "@LLVM_SRC_ROOT@"
#define LLVM_OBJ_ROOT "@LLVM_OBJ_ROOT@"
#define LLVM_CPPFLAGS "@LLVM_CPPFLAGS@"
#define LLVM_CFLAGS "@LLVM_CFLAGS@"
#define LLVM_LDFLAGS "@LLVM_LDFLAGS@"
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
#define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
#define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
#define LLVM_HAS_RTTI @LLVM_HAS_RTTI@
#define LLVM_ENABLE_DYLIB @LLVM_BUILD_LLVM_DYLIB@
#define LLVM_LINK_DYLIB @LLVM_LINK_LLVM_DYLIB@
#define LLVM_ENABLE_SHARED @BUILD_SHARED_LIBS@
#define LLVM_DYLIB_COMPONENTS "@LLVM_DYLIB_COMPONENTS@"
#define LLVM_DYLIB_VERSION "@LLVM_DYLIB_VERSION@"
#define LLVM_HAS_GLOBAL_ISEL @LLVM_HAS_GLOBAL_ISEL@
#define LLVM_TOOLS_INSTALL_DIR "@LLVM_TOOLS_INSTALL_DIR@"
set(LLVM_LINK_COMPONENTS support)
set(BUILDVARIABLES_SRCPATH ${CMAKE_CURRENT_SOURCE_DIR}/BuildVariables.inc.in)
set(BUILDVARIABLES_OBJPATH ${CMAKE_CURRENT_BINARY_DIR}/BuildVariables.inc)
# Add the hpvm-config tool.
add_llvm_tool(hpvm-config
hpvm-config.cpp
)
target_include_directories(
hpvm-config PRIVATE "${LLVM_BINARY_DIR}/tools/llvm-config"
)
# Compute the substitution values for various items.
get_property(SUPPORT_SYSTEM_LIBS TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS)
get_property(WINDOWSMANIFEST_SYSTEM_LIBS TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS)
foreach(l ${SUPPORT_SYSTEM_LIBS} ${WINDOWSMANIFEST_SYSTEM_LIBS})
if(MSVC)
set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}.lib")
else()
if (l MATCHES "^-")
# If it's an option, pass it without changes.
set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}")
else()
# Otherwise assume it's a library name we need to link with.
set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}")
endif()
endif()
endforeach()
string(REPLACE ";" " " SYSTEM_LIBS "${SYSTEM_LIBS}")
# Fetch target specific compile options, e.g. RTTI option
get_property(COMPILE_FLAGS TARGET hpvm-config PROPERTY COMPILE_FLAGS)
# The language standard potentially affects the ABI/API of LLVM, so we want
# to make sure it is reported by hpvm-config.
# NOTE: We don't want to start extracting any random C/CXX flags that the
# user may add that could affect the ABI. We only want to extract flags
# that have been added by the LLVM build system.
string(REGEX MATCH "-std=[^ ]\+" LLVM_CXX_STD_FLAG ${CMAKE_CXX_FLAGS})
string(REGEX MATCH "-stdlib=[^ ]\+" LLVM_CXX_STDLIB_FLAG ${CMAKE_CXX_FLAGS})
string(REGEX MATCH "-std=[^ ]\+" LLVM_C_STD_FLAG ${CMAKE_C_FLAGS})
# 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 "${LLVM_DEFINITIONS}")
set(LLVM_CFLAGS "${LLVM_C_STD_FLAG} ${LLVM_DEFINITIONS}")
set(LLVM_CXXFLAGS "${LLVM_CXX_STD_FLAG} ${LLVM_CXX_STDLIB_FLAG} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
set(LLVM_BUILD_SYSTEM cmake)
set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}")
set(LLVM_HAS_GLOBAL_ISEL "ON")
# Use the C++ link flags, since they should be a superset of C link flags.
set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
string(REPLACE ";" " " LLVM_TARGETS_BUILT "${LLVM_TARGETS_TO_BUILD}")
llvm_canonicalize_cmake_booleans(
LLVM_BUILD_LLVM_DYLIB
LLVM_LINK_LLVM_DYLIB
LLVM_HAS_RTTI
LLVM_HAS_GLOBAL_ISEL
BUILD_SHARED_LIBS)
configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY)
# Set build-time environment(s).
add_definitions(-DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}")
if(LLVM_ENABLE_MODULES)
target_compile_options(hpvm-config PUBLIC
"-fmodules-ignore-macro=CMAKE_CFG_INTDIR"
)
endif()
# Add the dependency on the generation step.
add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/hpvm-config.cpp ${BUILDVARIABLES_OBJPATH})
if(CMAKE_CROSSCOMPILING AND NOT HPVM_CONFIG_PATH)
build_native_tool(hpvm-config HPVM_CONFIG_PATH)
set(HPVM_CONFIG_PATH "${LLVM_CONFIG_PATH}" CACHE STRING "")
add_custom_target(NativeHPVMConfig DEPENDS ${HPVM_CONFIG_PATH})
add_dependencies(hpvm-config NativeHPVMConfig)
endif()
//===- llvm-build generated file --------------------------------*- C++ -*-===//
//
// Component Library Dependency Table
//
// Automatically generated file, do not edit!
//
//===----------------------------------------------------------------------===//
struct AvailableComponent {
/// The name of the component.
const char *Name;
/// The name of the library for this component (or NULL).
const char *Library;
/// Whether the component is installed.
bool IsInstalled;
/// The list of libraries required when linking this component.
const char *RequiredLibraries[24];
} AvailableComponents[73] = {
{ "aggressiveinstcombine", "LLVMAggressiveInstCombine", true, { "analysis", "core", "support", "transformutils" } },
{ "all", nullptr, true, { "all-targets", "coroutines", "coverage", "debuginfogsym", "dlltooldriver", "engine", "fuzzmutate", "gtest_main", "interpreter", "libdriver", "lineeditor", "lto", "mca", "mirparser", "nativecodegen", "objectyaml", "orcjit", "symbolize", "tablegen", "testingsupport", "textapi", "windowsmanifest", "xray" } },
{ "all-targets", nullptr, true, { "x86" } },
{ "analysis", "LLVMAnalysis", true, { "binaryformat", "core", "object", "profiledata", "support" } },
{ "asmparser", "LLVMAsmParser", true, { "binaryformat", "core", "support" } },
{ "asmprinter", "LLVMAsmPrinter", true, { "analysis", "binaryformat", "codegen", "core", "debuginfocodeview", "debuginfodwarf", "debuginfomsf", "mc", "mcparser", "remarks", "support", "target" } },
{ "binaryformat", "LLVMBinaryFormat", true, { "support" } },
{ "bitreader", "LLVMBitReader", true, { "bitstreamreader", "core", "support" } },
{ "bitstreamreader", "LLVMBitstreamReader", true, { "support" } },
{ "bitwriter", "LLVMBitWriter", true, { "analysis", "core", "mc", "object", "support" } },
{ "codegen", "LLVMCodeGen", true, { "analysis", "bitreader", "bitwriter", "core", "mc", "profiledata", "scalaropts", "support", "target", "transformutils" } },
{ "core", "LLVMCore", true, { "binaryformat", "remarks", "support" } },
{ "coroutines", "LLVMCoroutines", true, { "analysis", "core", "ipo", "scalaropts", "support", "transformutils" } },
{ "coverage", "LLVMCoverage", true, { "core", "object", "profiledata", "support" } },
{ "debuginfocodeview", "LLVMDebugInfoCodeView", true, { "support", "debuginfomsf" } },
{ "debuginfodwarf", "LLVMDebugInfoDWARF", true, { "binaryformat", "object", "mc", "support" } },
{ "debuginfogsym", "LLVMDebugInfoGSYM", true, { "support" } },
{ "debuginfomsf", "LLVMDebugInfoMSF", true, { "support" } },
{ "debuginfopdb", "LLVMDebugInfoPDB", true, { "object", "support", "debuginfocodeview", "debuginfomsf" } },
{ "demangle", "LLVMDemangle", true, { } },
{ "dlltooldriver", "LLVMDlltoolDriver", true, { "object", "option", "support" } },
{ "engine", nullptr, true, { "mcjit", "native" } },
{ "executionengine", "LLVMExecutionEngine", true, { "core", "mc", "object", "runtimedyld", "support", "target" } },
{ "fuzzmutate", "LLVMFuzzMutate", true, { "analysis", "bitreader", "bitwriter", "core", "scalaropts", "support", "target" } },
{ "globalisel", "LLVMGlobalISel", true, { "analysis", "codegen", "core", "mc", "selectiondag", "support", "target", "transformutils" } },
{ "gtest", "gtest", false, { "support" } },
{ "gtest_main", "gtest_main", false, { "gtest" } },
{ "instcombine", "LLVMInstCombine", true, { "analysis", "core", "support", "transformutils" } },
{ "instrumentation", "LLVMInstrumentation", true, { "analysis", "core", "mc", "support", "transformutils", "profiledata" } },
{ "interpreter", "LLVMInterpreter", true, { "codegen", "core", "executionengine", "support" } },
{ "ipo", "LLVMipo", true, { "aggressiveinstcombine", "analysis", "bitreader", "bitwriter", "core", "instcombine", "irreader", "linker", "object", "profiledata", "scalaropts", "support", "transformutils", "vectorize", "instrumentation" } },
{ "irreader", "LLVMIRReader", true, { "asmparser", "bitreader", "core", "support" } },
{ "jitlink", "LLVMJITLink", true, { "binaryformat", "object", "support" } },
{ "libdriver", "LLVMLibDriver", true, { "binaryformat", "bitreader", "object", "option", "support" } },
{ "lineeditor", "LLVMLineEditor", true, { "support" } },
{ "linker", "LLVMLinker", true, { "core", "support", "transformutils" } },
{ "lto", "LLVMLTO", true, { "aggressiveinstcombine", "analysis", "bitreader", "bitwriter", "codegen", "core", "ipo", "instcombine", "linker", "mc", "objcarcopts", "object", "passes", "remarks", "scalaropts", "support", "target", "transformutils" } },
{ "mc", "LLVMMC", true, { "support", "binaryformat", "debuginfocodeview" } },
{ "mca", "LLVMMCA", true, { "mc", "support" } },
{ "mcdisassembler", "LLVMMCDisassembler", true, { "mc", "support" } },
{ "mcjit", "LLVMMCJIT", true, { "core", "executionengine", "object", "runtimedyld", "support", "target" } },
{ "mcparser", "LLVMMCParser", true, { "mc", "support" } },
{ "mirparser", "LLVMMIRParser", true, { "asmparser", "binaryformat", "codegen", "core", "mc", "support", "target" } },
{ "native", nullptr, true, { "x86" } },
{ "nativecodegen", nullptr, true, { "x86codegen" } },
{ "objcarcopts", "LLVMObjCARCOpts", true, { "analysis", "core", "support", "transformutils" } },
{ "object", "LLVMObject", true, { "bitreader", "core", "mc", "binaryformat", "mcparser", "support" } },
{ "objectyaml", "LLVMObjectYAML", true, { "object", "support", "debuginfocodeview" } },
{ "option", "LLVMOption", true, { "support" } },
{ "orcjit", "LLVMOrcJIT", true, { "core", "executionengine", "jitlink", "object", "mc", "runtimedyld", "support", "target", "transformutils" } },
{ "passes", "LLVMPasses", true, { "aggressiveinstcombine", "analysis", "codegen", "core", "ipo", "instcombine", "scalaropts", "support", "target", "transformutils", "vectorize", "instrumentation" } },
{ "profiledata", "LLVMProfileData", true, { "core", "support" } },
{ "remarks", "LLVMRemarks", true, { "support" } },
{ "runtimedyld", "LLVMRuntimeDyld", true, { "mc", "object", "support" } },
{ "scalaropts", "LLVMScalarOpts", true, { "aggressiveinstcombine", "analysis", "core", "instcombine", "support", "transformutils" } },
{ "selectiondag", "LLVMSelectionDAG", true, { "analysis", "codegen", "core", "mc", "support", "target", "transformutils" } },
{ "support", "LLVMSupport", true, { "demangle" } },
{ "symbolize", "LLVMSymbolize", true, { "debuginfodwarf", "debuginfopdb", "object", "support", "demangle" } },
{ "tablegen", "LLVMTableGen", true, { "support" } },
{ "target", "LLVMTarget", true, { "analysis", "core", "mc", "support" } },
{ "testingsupport", "LLVMTestingSupport", false, { "support" } },
{ "textapi", "LLVMTextAPI", true, { "support", "binaryformat" } },
{ "transformutils", "LLVMTransformUtils", true, { "analysis", "core", "support" } },
{ "vectorize", "LLVMVectorize", true, { "analysis", "core", "support", "transformutils" } },
{ "windowsmanifest", "LLVMWindowsManifest", true, { "support" } },
{ "x86", nullptr, true, { "x86info", "x86utils", "x86desc", "x86codegen", "x86asmparser", "x86disassembler" } },
{ "x86asmparser", "LLVMX86AsmParser", true, { "mc", "mcparser", "support", "x86desc", "x86info" } },
{ "x86codegen", "LLVMX86CodeGen", true, { "analysis", "asmprinter", "codegen", "core", "mc", "selectiondag", "support", "target", "x86desc", "x86info", "x86utils", "globalisel", "profiledata" } },
{ "x86desc", "LLVMX86Desc", true, { "mc", "mcdisassembler", "object", "support", "x86info", "x86utils" } },
{ "x86disassembler", "LLVMX86Disassembler", true, { "mcdisassembler", "support", "x86info" } },
{ "x86info", "LLVMX86Info", true, { "support" } },
{ "x86utils", "LLVMX86Utils", true, { "support" } },
{ "xray", "LLVMXRay", true, { "support", "object" } },
};
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment