[llvm] r366615 - Revert r366610 and r366612: Expand pseudo-components before embedding in llvm-config
Daniel Sanders via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 19 14:11:05 PDT 2019
Author: dsanders
Date: Fri Jul 19 14:11:05 2019
New Revision: 366615
URL: http://llvm.org/viewvc/llvm-project?rev=366615&view=rev
Log:
Revert r366610 and r366612: Expand pseudo-components before embedding in llvm-config
Some targets are missing LLVMDemangle, one is adding the LLVM prefix twice, and two
are hitting the very error this patch fixes for my target. Reverting while I work
through the reports.
Modified:
llvm/trunk/cmake/modules/LLVM-Config.cmake
llvm/trunk/tools/llvm-config/BuildVariables.inc.in
llvm/trunk/tools/llvm-config/CMakeLists.txt
Modified: llvm/trunk/cmake/modules/LLVM-Config.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVM-Config.cmake?rev=366615&r1=366614&r2=366615&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVM-Config.cmake (original)
+++ llvm/trunk/cmake/modules/LLVM-Config.cmake Fri Jul 19 14:11:05 2019
@@ -117,156 +117,140 @@ function(llvm_map_components_to_librarie
set( ${OUT_VAR} ${result} ${sys_result} PARENT_SCOPE )
endfunction(llvm_map_components_to_libraries)
-# Expand pseudo-components into real components.
-# Does not cover 'native', 'backend', or 'engine' as these require special
-# handling.
-function(llvm_expand_pseudo_components out_components)
+# This is a variant intended for the final user:
+# Map LINK_COMPONENTS to actual libnames.
+function(llvm_map_components_to_libnames out_libs)
set( link_components ${ARGN} )
+ if(NOT LLVM_AVAILABLE_LIBS)
+ # Inside LLVM itself available libs are in a global property.
+ get_property(LLVM_AVAILABLE_LIBS GLOBAL PROPERTY LLVM_LIBS)
+ endif()
+ string(TOUPPER "${LLVM_AVAILABLE_LIBS}" capitalized_libs)
+
+ get_property(LLVM_TARGETS_CONFIGURED GLOBAL PROPERTY LLVM_TARGETS_CONFIGURED)
+
+ # Generally in our build system we avoid order-dependence. Unfortunately since
+ # not all targets create the same set of libraries we actually need to ensure
+ # that all build targets associated with a target are added before we can
+ # process target dependencies.
+ if(NOT LLVM_TARGETS_CONFIGURED)
+ foreach(c ${link_components})
+ is_llvm_target_specifier(${c} iltl_result ALL_TARGETS)
+ if(iltl_result)
+ message(FATAL_ERROR "Specified target library before target registration is complete.")
+ endif()
+ endforeach()
+ endif()
+
+ # Expand some keywords:
+ list(FIND LLVM_TARGETS_TO_BUILD "${LLVM_NATIVE_ARCH}" have_native_backend)
+ list(FIND link_components "engine" engine_required)
+ if( NOT engine_required EQUAL -1 )
+ list(FIND LLVM_TARGETS_WITH_JIT "${LLVM_NATIVE_ARCH}" have_jit)
+ if( NOT have_native_backend EQUAL -1 AND NOT have_jit EQUAL -1 )
+ list(APPEND link_components "jit")
+ list(APPEND link_components "native")
+ else()
+ list(APPEND link_components "interpreter")
+ endif()
+ endif()
+ list(FIND link_components "native" native_required)
+ if( NOT native_required EQUAL -1 )
+ if( NOT have_native_backend EQUAL -1 )
+ list(APPEND link_components ${LLVM_NATIVE_ARCH})
+ endif()
+ endif()
+
+ # Translate symbolic component names to real libraries:
foreach(c ${link_components})
# add codegen, asmprinter, asmparser, disassembler
list(FIND LLVM_TARGETS_TO_BUILD ${c} idx)
if( NOT idx LESS 0 )
if( TARGET LLVM${c}CodeGen )
- list(APPEND expanded_components "${c}CodeGen")
+ list(APPEND expanded_components "LLVM${c}CodeGen")
else()
if( TARGET LLVM${c} )
- list(APPEND expanded_components "${c}")
+ list(APPEND expanded_components "LLVM${c}")
else()
message(FATAL_ERROR "Target ${c} is not in the set of libraries.")
endif()
endif()
- if( TARGET LLVM${c}AsmPrinter )
- list(APPEND expanded_components "${c}AsmPrinter")
- endif()
if( TARGET LLVM${c}AsmParser )
- list(APPEND expanded_components "${c}AsmParser")
+ list(APPEND expanded_components "LLVM${c}AsmParser")
+ endif()
+ if( TARGET LLVM${c}AsmPrinter )
+ list(APPEND expanded_components "LLVM${c}AsmPrinter")
endif()
if( TARGET LLVM${c}Desc )
- list(APPEND expanded_components "${c}Desc")
+ list(APPEND expanded_components "LLVM${c}Desc")
endif()
if( TARGET LLVM${c}Disassembler )
- list(APPEND expanded_components "${c}Disassembler")
+ list(APPEND expanded_components "LLVM${c}Disassembler")
endif()
if( TARGET LLVM${c}Info )
- list(APPEND expanded_components "${c}Info")
+ list(APPEND expanded_components "LLVM${c}Info")
endif()
if( TARGET LLVM${c}Utils )
- list(APPEND expanded_components "${c}Utils")
+ list(APPEND expanded_components "LLVM${c}Utils")
endif()
+ elseif( c STREQUAL "native" )
+ # already processed
elseif( c STREQUAL "nativecodegen" )
- if( TARGET LLVM${LLVM_NATIVE_ARCH}CodeGen )
- list(APPEND expanded_components "${LLVM_NATIVE_ARCH}CodeGen")
- endif()
+ list(APPEND expanded_components "LLVM${LLVM_NATIVE_ARCH}CodeGen")
if( TARGET LLVM${LLVM_NATIVE_ARCH}Desc )
- list(APPEND expanded_components "${LLVM_NATIVE_ARCH}Desc")
+ list(APPEND expanded_components "LLVM${LLVM_NATIVE_ARCH}Desc")
endif()
if( TARGET LLVM${LLVM_NATIVE_ARCH}Info )
- list(APPEND expanded_components "${LLVM_NATIVE_ARCH}Info")
+ list(APPEND expanded_components "LLVM${LLVM_NATIVE_ARCH}Info")
endif()
+ elseif( c STREQUAL "backend" )
+ # same case as in `native'.
+ elseif( c STREQUAL "engine" )
+ # already processed
elseif( c STREQUAL "all" )
list(APPEND expanded_components ${LLVM_AVAILABLE_LIBS})
elseif( c STREQUAL "AllTargetsCodeGens" )
# Link all the codegens from all the targets
foreach(t ${LLVM_TARGETS_TO_BUILD})
if( TARGET LLVM${t}CodeGen)
- list(APPEND expanded_components "${t}CodeGen")
+ list(APPEND expanded_components "LLVM${t}CodeGen")
endif()
endforeach(t)
elseif( c STREQUAL "AllTargetsAsmPrinters" )
# Link all the asm printers from all the targets
foreach(t ${LLVM_TARGETS_TO_BUILD})
if( TARGET LLVM${t}AsmPrinter )
- list(APPEND expanded_components "${t}AsmPrinter")
+ list(APPEND expanded_components "LLVM${t}AsmPrinter")
endif()
endforeach(t)
elseif( c STREQUAL "AllTargetsAsmParsers" )
# Link all the asm parsers from all the targets
foreach(t ${LLVM_TARGETS_TO_BUILD})
if( TARGET LLVM${t}AsmParser )
- list(APPEND expanded_components "${t}AsmParser")
+ list(APPEND expanded_components "LLVM${t}AsmParser")
endif()
endforeach(t)
elseif( c STREQUAL "AllTargetsDescs" )
# Link all the descs from all the targets
foreach(t ${LLVM_TARGETS_TO_BUILD})
if( TARGET LLVM${t}Desc )
- list(APPEND expanded_components "${t}Desc")
+ list(APPEND expanded_components "LLVM${t}Desc")
endif()
endforeach(t)
elseif( c STREQUAL "AllTargetsDisassemblers" )
# Link all the disassemblers from all the targets
foreach(t ${LLVM_TARGETS_TO_BUILD})
if( TARGET LLVM${t}Disassembler )
- list(APPEND expanded_components "${t}Disassembler")
+ list(APPEND expanded_components "LLVM${t}Disassembler")
endif()
endforeach(t)
elseif( c STREQUAL "AllTargetsInfos" )
# Link all the infos from all the targets
foreach(t ${LLVM_TARGETS_TO_BUILD})
if( TARGET LLVM${t}Info )
- list(APPEND expanded_components "${t}Info")
+ list(APPEND expanded_components "LLVM${t}Info")
endif()
endforeach(t)
- else()
- list(APPEND expanded_components "${c}")
- endif()
- endforeach()
- set(${out_components} ${expanded_components} PARENT_SCOPE)
-endfunction(llvm_expand_pseudo_components out_components)
-
-# This is a variant intended for the final user:
-# Map LINK_COMPONENTS to actual libnames.
-function(llvm_map_components_to_libnames out_libs)
- set( link_components ${ARGN} )
- if(NOT LLVM_AVAILABLE_LIBS)
- # Inside LLVM itself available libs are in a global property.
- get_property(LLVM_AVAILABLE_LIBS GLOBAL PROPERTY LLVM_LIBS)
- endif()
- string(TOUPPER "${LLVM_AVAILABLE_LIBS}" capitalized_libs)
-
- get_property(LLVM_TARGETS_CONFIGURED GLOBAL PROPERTY LLVM_TARGETS_CONFIGURED)
-
- # Generally in our build system we avoid order-dependence. Unfortunately since
- # not all targets create the same set of libraries we actually need to ensure
- # that all build targets associated with a target are added before we can
- # process target dependencies.
- if(NOT LLVM_TARGETS_CONFIGURED)
- foreach(c ${link_components})
- is_llvm_target_specifier(${c} iltl_result ALL_TARGETS)
- if(iltl_result)
- message(FATAL_ERROR "Specified target library before target registration is complete.")
- endif()
- endforeach()
- endif()
-
- # Expand some keywords:
- list(FIND LLVM_TARGETS_TO_BUILD "${LLVM_NATIVE_ARCH}" have_native_backend)
- list(FIND link_components "engine" engine_required)
- if( NOT engine_required EQUAL -1 )
- list(FIND LLVM_TARGETS_WITH_JIT "${LLVM_NATIVE_ARCH}" have_jit)
- if( NOT have_native_backend EQUAL -1 AND NOT have_jit EQUAL -1 )
- list(APPEND link_components "jit")
- list(APPEND link_components "native")
- else()
- list(APPEND link_components "interpreter")
- endif()
- endif()
- list(FIND link_components "native" native_required)
- if( NOT native_required EQUAL -1 )
- if( NOT have_native_backend EQUAL -1 )
- list(APPEND link_components ${LLVM_NATIVE_ARCH})
- endif()
- endif()
-
- # Translate symbolic component names to real libraries:
- llvm_expand_pseudo_components(link_components ${link_components})
- foreach(c ${link_components})
- if( c STREQUAL "native" )
- # already processed
- elseif( c STREQUAL "backend" )
- # same case as in `native'.
- elseif( c STREQUAL "engine" )
- # already processed
else( NOT idx LESS 0 )
# Canonize the component name:
string(TOUPPER "${c}" capitalized)
@@ -288,7 +272,7 @@ function(llvm_map_components_to_libnames
list(GET LLVM_AVAILABLE_LIBS ${lib_idx} canonical_lib)
list(APPEND expanded_components ${canonical_lib})
endif( lib_idx LESS 0 )
- endif( c STREQUAL "native" )
+ endif( NOT idx LESS 0 )
endforeach(c)
set(${out_libs} ${expanded_components} PARENT_SCOPE)
Modified: llvm/trunk/tools/llvm-config/BuildVariables.inc.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/BuildVariables.inc.in?rev=366615&r1=366614&r2=366615&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/BuildVariables.inc.in (original)
+++ llvm/trunk/tools/llvm-config/BuildVariables.inc.in Fri Jul 19 14:11:05 2019
@@ -30,7 +30,7 @@
#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_expanded@"
+#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@"
Modified: llvm/trunk/tools/llvm-config/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/CMakeLists.txt?rev=366615&r1=366614&r2=366615&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-config/CMakeLists.txt Fri Jul 19 14:11:05 2019
@@ -60,7 +60,6 @@ llvm_canonicalize_cmake_booleans(
LLVM_HAS_RTTI
LLVM_HAS_GLOBAL_ISEL
BUILD_SHARED_LIBS)
-llvm_expand_pseudo_components(LLVM_DYLIB_COMPONENTS_expanded "${LLVM_DYLIB_COMPONENTS}")
configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY)
# Set build-time environment(s).
More information about the llvm-commits
mailing list