build/Make & CMake: Pass the appropriate --native-target and --enable-targets

options to llvm-build, so the all-targets etc. components are defined properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144255 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2011-11-10 01:16:48 +00:00
parent affc6cf9d2
commit 8333730259
4 changed files with 17 additions and 6 deletions

View File

@ -236,6 +236,8 @@ set(LLVMBUILDCMAKEFRAG
message(STATUS "Constructing LLVMBuild project information") message(STATUS "Constructing LLVMBuild project information")
execute_process( execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${LLVMBUILDTOOL} COMMAND ${PYTHON_EXECUTABLE} ${LLVMBUILDTOOL}
--native-target "${LLVM_NATIVE_ARCH}"
--enable-targets "${LLVM_TARGETS_TO_BUILD}"
--write-library-table ${LLVMCONFIGLIBRARYDEPENDENCIESINC} --write-library-table ${LLVMCONFIGLIBRARYDEPENDENCIESINC}
--write-cmake-fragment ${LLVMBUILDCMAKEFRAG} --write-cmake-fragment ${LLVMBUILDCMAKEFRAG}
ERROR_VARIABLE LLVMBUILDOUTPUT ERROR_VARIABLE LLVMBUILDOUTPUT

View File

@ -92,6 +92,8 @@ LLVMConfigLibraryDependenciesInc := \
$(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules $(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules
$(Echo) Constructing LLVMBuild project information. $(Echo) Constructing LLVMBuild project information.
$(Verb) $(LLVMBuildTool) \ $(Verb) $(LLVMBuildTool) \
--native-target "$(ARCH)" \
--enable-targets "$(TARGETS_TO_BUILD)" \
--write-library-table $(LLVMConfigLibraryDependenciesInc) \ --write-library-table $(LLVMConfigLibraryDependenciesInc) \
--write-make-fragment $(LLVMBuildMakeFrag) --write-make-fragment $(LLVMBuildMakeFrag)

View File

@ -21,8 +21,9 @@ name = Target
parent = Libraries parent = Libraries
required_libraries = Core MC Support required_libraries = Core MC Support
; This is a convenient group we define (and expect targets to add to) which ; This is a special group whose required libraries are extended (by llvm-build)
; makes it easy for tools to include every target. ; with every built target, which makes it easy for tools to include every
; target.
[component_1] [component_1]
type = LibraryGroup type = LibraryGroup
name = all-targets name = all-targets

View File

@ -505,7 +505,7 @@ def add_magic_target_components(parser, project, opts):
determined based on the target configuration options. determined based on the target configuration options.
This currently is responsible for populating the required_libraries list of This currently is responsible for populating the required_libraries list of
the "Native", "NativeCodeGen", and "Engine" components. the "all-targets", "Native", "NativeCodeGen", and "Engine" components.
""" """
# Determine the available targets. # Determine the available targets.
@ -536,8 +536,14 @@ def add_magic_target_components(parser, project, opts):
if opts.enable_targets is None: if opts.enable_targets is None:
enable_targets = available_targets.values() enable_targets = available_targets.values()
else: else:
# We support both space separated and semi-colon separated lists.
if ' ' in opts.enable_targets:
enable_target_names = opts.enable_targets.split()
else:
enable_target_names = opts.enable_targets.split(';')
enable_targets = [] enable_targets = []
for name in opts.enable_targets.split(): for name in enable_target_names:
target = available_targets.get(name) target = available_targets.get(name)
if target is None: if target is None:
parser.error("invalid target to enable: %r (not in project)" % ( parser.error("invalid target to enable: %r (not in project)" % (
@ -641,8 +647,8 @@ def main():
action="store", default=None) action="store", default=None)
group.add_option("", "--enable-targets", group.add_option("", "--enable-targets",
dest="enable_targets", metavar="NAMES", dest="enable_targets", metavar="NAMES",
help=("Enable the given space separated list of targets, " help=("Enable the given space or semi-colon separated "
"or all targets if not present"), "list of targets, or all targets if not present"),
action="store", default=None) action="store", default=None)
parser.add_option_group(group) parser.add_option_group(group)