Files
swift-lang/llbuild.patch
Steven R. Baker e0663af080 Fix llbuild link failure: use find_package(Curses) instead of hardcoded -lcurses
openSUSE Tumbleweed's ncurses-devel does not provide a libcurses.so
symlink (unlike Fedora), causing llbuild to fail at link time with
'cannot find -lcurses'. Use CMake's FindCurses module to properly
discover the ncurses library path on all platforms.
2026-02-18 18:10:58 +01:00

71 lines
2.4 KiB
Diff

diff --git llbuild.orig/utils/unittest/googletest/include/gtest/gtest.h llbuild/utils/unittest/googletest/include/gtest/gtest.h
index eb5c5cc0..30c8d68a 100644
--- llbuild.orig/utils/unittest/googletest/include/gtest/gtest.h
+++ llbuild/utils/unittest/googletest/include/gtest/gtest.h
@@ -51,6 +51,7 @@
#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_H_
+#include <cstdint>
#include <cstddef>
#include <limits>
#include <memory>
diff --git llbuild.orig/CMakeLists.txt llbuild/CMakeLists.txt
--- llbuild.orig/CMakeLists.txt
+++ llbuild/CMakeLists.txt
@@ -50,6 +50,8 @@
set(THREADS_PREFER_PTHREAD_FLAG FALSE)
find_package(Threads REQUIRED)
+find_package(Curses REQUIRED)
+
find_package(SQLite3 QUIET)
if(NOT SQLite3_FOUND)
include(FetchContent)
diff --git llbuild.orig/lib/llvm/Support/CMakeLists.txt llbuild/lib/llvm/Support/CMakeLists.txt
--- llbuild.orig/lib/llvm/Support/CMakeLists.txt
+++ llbuild/lib/llvm/Support/CMakeLists.txt
@@ -65,7 +65,7 @@
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Android|Darwin|Linux|FreeBSD")
- target_link_libraries(llvmSupport PRIVATE curses)
+ target_link_libraries(llvmSupport PRIVATE ${CURSES_LIBRARIES})
endif()
set_property(GLOBAL APPEND PROPERTY LLBuild_EXPORTS llvmSupport)
diff --git llbuild.orig/products/llbuild/CMakeLists.txt llbuild/products/llbuild/CMakeLists.txt
--- llbuild.orig/products/llbuild/CMakeLists.txt
+++ llbuild/products/llbuild/CMakeLists.txt
@@ -16,5 +16,5 @@
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(llbuild PRIVATE
- curses)
+ ${CURSES_LIBRARIES})
endif()
diff --git llbuild.orig/products/swift-build-tool/CMakeLists.txt llbuild/products/swift-build-tool/CMakeLists.txt
--- llbuild.orig/products/swift-build-tool/CMakeLists.txt
+++ llbuild/products/swift-build-tool/CMakeLists.txt
@@ -10,7 +10,7 @@
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(swift-build-tool PRIVATE
- curses)
+ ${CURSES_LIBRARIES})
endif()
install(TARGETS swift-build-tool
diff --git llbuild.orig/products/libllbuild/CMakeLists.txt llbuild/products/libllbuild/CMakeLists.txt
--- llbuild.orig/products/libllbuild/CMakeLists.txt
+++ llbuild/products/libllbuild/CMakeLists.txt
@@ -28,7 +28,7 @@
if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
target_link_libraries(libllbuild PRIVATE
- curses)
+ ${CURSES_LIBRARIES})
endif()
target_include_directories(libllbuild