[Debuginfod][CMake] Don't build a defunct llvm-debuginfod
authorDaniel Thornburgh <dthorn@google.com>
Wed, 29 Mar 2023 21:08:37 +0000 (14:08 -0700)
committerDaniel Thornburgh <dthorn@google.com>
Wed, 29 Mar 2023 23:18:21 +0000 (16:18 -0700)
llvm-debuginfod intrinsically requires cpp-httplib to operate, so
exclude the target if it's unavailable. Right now the tool walks off an
llvm_unreachable.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D147185

llvm/test/CMakeLists.txt
llvm/test/lit.cfg.py
llvm/tools/CMakeLists.txt

index 9339940..2ac51aa 100644 (file)
@@ -79,7 +79,6 @@ set(LLVM_TEST_DEPENDS
           llvm-cxxfilt
           llvm-cxxmap
           llvm-debuginfo-analyzer
-          llvm-debuginfod
           llvm-debuginfod-find
           llvm-diff
           llvm-dis
@@ -220,6 +219,10 @@ if (LLVM_INCLUDE_DXIL_TESTS)
   list(APPEND LLVM_TEST_DEPENDS dxil-dis)
 endif()
 
+if(LLVM_ENABLE_HTTPLIB)
+  list(APPEND LLVM_TEST_DEPENDS llvm-debuginfod)
+endif()
+
 add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS})
 set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests")
 
index 3aa82ab..a576405 100644 (file)
@@ -158,7 +158,7 @@ tools = [
 tools.extend([
     'dsymutil', 'lli', 'lli-child-target', 'llvm-ar', 'llvm-as',
     'llvm-addr2line', 'llvm-bcanalyzer', 'llvm-bitcode-strip', 'llvm-config',
-    'llvm-cov', 'llvm-cxxdump', 'llvm-cvtres', 'llvm-debuginfod-find', 'llvm-debuginfod',
+    'llvm-cov', 'llvm-cxxdump', 'llvm-cvtres', 'llvm-debuginfod-find',
     'llvm-debuginfo-analyzer',
     'llvm-diff', 'llvm-dis', 'llvm-dwarfdump', 'llvm-dwarfutil', 'llvm-dlltool',
     'llvm-exegesis', 'llvm-extract', 'llvm-isel-fuzzer', 'llvm-ifs',
@@ -176,6 +176,7 @@ tools.extend([
 # The following tools are optional
 tools.extend([
     ToolSubst('llvm-mt', unresolved='ignore'),
+    ToolSubst('llvm-debuginfod', unresolved='ignore'),
     ToolSubst('Kaleidoscope-Ch3', unresolved='ignore'),
     ToolSubst('Kaleidoscope-Ch4', unresolved='ignore'),
     ToolSubst('Kaleidoscope-Ch5', unresolved='ignore'),
index c6116ac..2113b6a 100644 (file)
@@ -21,6 +21,10 @@ if(CYGWIN OR NOT LLVM_ENABLE_PIC)
   set(LLVM_TOOL_LTO_BUILD Off)
 endif()
 
+if(NOT LLVM_ENABLE_HTTPLIB)
+  set(LLVM_TOOL_LLVM_DEBUGINFOD_BUILD Off)
+endif()
+
 if (LLVM_TOOL_LLVM_DRIVER_BUILD)
   add_llvm_tool(llvm-driver)
 endif()