Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions recipes/llvm-core/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
sources:
"20.1.6":
"llvm":
url: https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.6/llvm-20.1.6.src.tar.xz
sha256: f09e304ca98bb809f492ec34f94f587361b4b0d06ed783fb3a41e7fb218e47a1
"cmake":
url: https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.6/cmake-20.1.6.src.tar.xz
sha256: b4b3efa5d5b01b3f211f1ba326bb6f0c318331f828202d332c95b7f30fca5f8c
"19.1.7":
"llvm":
url: https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.7/llvm-19.1.7.src.tar.xz
Expand All @@ -17,6 +24,11 @@ sources:
sha256: ce8508e318a01a63d4e8b3090ab2ded3c598a50258cc49e2625b9120d4c03ea5

patches:
"20.1.6":
- patch_file: patches/20x/0000-cmake-dependencies.patch
patch_description: fix references to third party libs to match conan variables and targets
patch_type: conan
base_path: llvm-main
"19.1.7":
- patch_file: patches/19x/0000-cmake-dependencies.patch
patch_description: fix references to third party libs to match conan variables and targets
Expand Down
7 changes: 6 additions & 1 deletion recipes/llvm-core/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"PowerPC",
"RISCV",
"Sparc",
"SPIRV",
"SystemZ",
"VE",
"WebAssembly",
Expand Down Expand Up @@ -325,7 +326,11 @@ def _targets_to_build(self):

@property
def _all_targets(self):
targets = LLVM_TARGETS if Version(self.version) >= 14 else LLVM_TARGETS - {"LoongArch", "VE"}
targets = LLVM_TARGETS
if Version(self.version) < 20:
targets -= {"SPIRV"}
if Version(self.version) < 14:
targets -= {"LoongArch", "VE"}
return ";".join(targets)

def generate(self):
Expand Down
93 changes: 93 additions & 0 deletions recipes/llvm-core/all/patches/20x/0000-cmake-dependencies.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 767774812ade..7a037ce02fb1 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -173,7 +173,7 @@ if(LLVM_ENABLE_ZLIB)
# library on a 64-bit system which would result in a link-time failure.
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY})
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES})
check_symbol_exists(compress2 zlib.h HAVE_ZLIB)
cmake_pop_check_state()
if(LLVM_ENABLE_ZLIB STREQUAL FORCE_ON AND NOT HAVE_ZLIB)
@@ -268,11 +268,11 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
# Skip libedit if using ASan as it contains memory leaks.
if (LLVM_ENABLE_LIBEDIT AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*")
if(LLVM_ENABLE_LIBEDIT STREQUAL FORCE_ON)
- find_package(LibEdit REQUIRED)
+ find_package(editline REQUIRED)
else()
- find_package(LibEdit)
+ find_package(editline)
endif()
- set(HAVE_LIBEDIT "${LibEdit_FOUND}")
+ set(HAVE_LIBEDIT "${editline_FOUND}")
else()
set(HAVE_LIBEDIT 0)
endif()
diff --git a/lib/LineEditor/CMakeLists.txt b/lib/LineEditor/CMakeLists.txt
index c4cd91cbb0cd..b95d073d9725 100644
--- a/lib/LineEditor/CMakeLists.txt
+++ b/lib/LineEditor/CMakeLists.txt
@@ -1,5 +1,5 @@
if(HAVE_LIBEDIT)
- set(link_libs LibEdit::LibEdit)
+ set(link_libs editline::editline)
endif()

add_llvm_component_library(LLVMLineEditor
diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt
index a6d8a2581886..e33c86c159bc 100644
--- a/lib/Support/CMakeLists.txt
+++ b/lib/Support/CMakeLists.txt
@@ -316,27 +316,13 @@ set(llvm_system_libs ${system_libs})
# This block is only needed for llvm-config. When we deprecate llvm-config and
# move to using CMake export, this block can be removed.
if(LLVM_ENABLE_ZLIB)
- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators.
- if(CMAKE_BUILD_TYPE)
- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
- get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION_${build_type})
- endif()
- if(NOT zlib_library)
- get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION)
- endif()
+ set(zlib_library ${ZLIB_LIBRARIES})
get_library_name(${zlib_library} zlib_library)
set(llvm_system_libs ${llvm_system_libs} "${zlib_library}")
endif()

if(LLVM_ENABLE_ZSTD)
- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators.
- if(CMAKE_BUILD_TYPE)
- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
- get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION_${build_type})
- endif()
- if(NOT zstd_library)
- get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION)
- endif()
+ set(zstd_library ${zstd_LIBRARIES})
if (zstd_target STREQUAL zstd::libzstd_shared)
get_library_name(${zstd_library} zstd_library)
set(llvm_system_libs ${llvm_system_libs} "${zstd_library}")
diff --git a/lib/WindowsManifest/CMakeLists.txt b/lib/WindowsManifest/CMakeLists.txt
index 910132a4c7de..f4d91c9d56da 100644
--- a/lib/WindowsManifest/CMakeLists.txt
+++ b/lib/WindowsManifest/CMakeLists.txt
@@ -21,14 +21,7 @@ add_llvm_component_library(LLVMWindowsManifest
# This block is only needed for llvm-config. When we deprecate llvm-config and
# move to using CMake export, this block can be removed.
if(LLVM_ENABLE_LIBXML2)
- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators.
- if(CMAKE_BUILD_TYPE)
- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type})
- endif()
- if(NOT libxml2_library)
- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION)
- endif()
+ set(libxml2_library ${libxml2_LIBRARIES})
get_library_name(${libxml2_library} libxml2_library)
set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library})
endif()
2 changes: 2 additions & 0 deletions recipes/llvm-core/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"20.1.6":
folder: all
"19.1.7":
folder: all
"13.0.0":
Expand Down