Initial commit
This commit is contained in:
51
tools/cmake/Makefile
Normal file
51
tools/cmake/Makefile
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright (C) 2006-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=cmake
|
||||
PKG_VERSION:=3.21.3
|
||||
PKG_RELEASE:=1
|
||||
PKG_CPE_ID:=cpe:/a:kitware:cmake
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \
|
||||
https://cmake.org/files/v3.19/
|
||||
PKG_HASH:=d14d06df4265134ee42c4d50f5a60cb8b471b7b6a47da8e5d914d49dd783794f
|
||||
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
HOST_CONFIGURE_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
HOST_CONFIGURE_VARS += \
|
||||
CC="$(HOSTCC_NOCACHE)" \
|
||||
CXX="$(HOSTCXX_NOCACHE)" \
|
||||
MAKEFLAGS="$(HOST_JOBS)" \
|
||||
CXXFLAGS="$(HOST_CFLAGS)"
|
||||
|
||||
HOST_CONFIGURE_ARGS := \
|
||||
$(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \
|
||||
--prefix="$(STAGING_DIR_HOST)" \
|
||||
--generator=Ninja
|
||||
|
||||
define Host/Compile/Default
|
||||
+$(NINJA) -C $(HOST_BUILD_DIR) $(1)
|
||||
endef
|
||||
|
||||
define Host/Install/Default
|
||||
+$(NINJA) -C $(HOST_BUILD_DIR) install
|
||||
endef
|
||||
|
||||
define Host/Uninstall/Default
|
||||
+$(NINJA) -C $(HOST_BUILD_DIR) uninstall
|
||||
endef
|
||||
|
||||
ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
|
||||
HOST_MAKE_FLAGS += VERBOSE=1
|
||||
endif
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
33
tools/cmake/patches/100-no-testing.patch
Normal file
33
tools/cmake/patches/100-no-testing.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
--- a/Modules/CTest.cmake
|
||||
+++ b/Modules/CTest.cmake
|
||||
@@ -47,7 +47,7 @@ the :variable:`CTEST_USE_LAUNCHERS` vari
|
||||
in the ``CTestConfig.cmake`` file.
|
||||
#]=======================================================================]
|
||||
|
||||
-option(BUILD_TESTING "Build the testing tree." ON)
|
||||
+option(BUILD_TESTING "Build the testing tree." OFF)
|
||||
|
||||
# function to turn generator name into a version string
|
||||
# like vs9 or vs10
|
||||
--- a/Modules/Dart.cmake
|
||||
+++ b/Modules/Dart.cmake
|
||||
@@ -33,7 +33,7 @@ whether testing support should be enable
|
||||
#
|
||||
#
|
||||
|
||||
-option(BUILD_TESTING "Build the testing tree." ON)
|
||||
+option(BUILD_TESTING "Build the testing tree." OFF)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
find_package(Dart QUIET)
|
||||
--- a/Tests/Contracts/VTK/Dashboard.cmake.in
|
||||
+++ b/Tests/Contracts/VTK/Dashboard.cmake.in
|
||||
@@ -25,7 +25,7 @@ ctest_empty_binary_directory(${CTEST_BIN
|
||||
|
||||
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
|
||||
VTK_BUILD_EXAMPLES:BOOL=ON
|
||||
- VTK_BUILD_TESTING:STRING=WANT
|
||||
+ VTK_BUILD_TESTING:STRING=OFF
|
||||
VTK_WRAP_PYTHON:BOOL=ON
|
||||
ExternalData_OBJECT_STORES:FILEPATH=@base_dir@/ExternalData
|
||||
")
|
||||
37
tools/cmake/patches/120-curl-fix-libressl-linking.patch
Normal file
37
tools/cmake/patches/120-curl-fix-libressl-linking.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
From: Jo-Philipp Wich <jo@mein.io>
|
||||
Date: Wed, 11 Jan 2017 03:36:04 +0100
|
||||
Subject: [PATCH] cmcurl: link librt
|
||||
|
||||
When cmake is linked against LibreSSL, there might be an indirect
|
||||
dependency on librt on certain systems if LibreSSL's libcrypto uses
|
||||
clock_gettime() from librt:
|
||||
|
||||
[ 28%] Linking C executable LIBCURL
|
||||
.../lib/libcrypto.a(getentropy_linux.o): In function `getentropy_fallback':
|
||||
getentropy_linux.c:(.text+0x16d): undefined reference to `clock_gettime'
|
||||
getentropy_linux.c:(.text+0x412): undefined reference to `clock_gettime'
|
||||
collect2: error: ld returned 1 exit status
|
||||
make[5]: *** [Utilities/cmcurl/LIBCURL] Error 1
|
||||
|
||||
Modify the cmcurl CMakeLists.txt to check for clock_gettime() in librt
|
||||
and unconditionally link the rt library when the symbol is found.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
---
|
||||
--- a/Utilities/cmcurl/CMakeLists.txt
|
||||
+++ b/Utilities/cmcurl/CMakeLists.txt
|
||||
@@ -528,6 +528,14 @@ if(CMAKE_USE_OPENSSL)
|
||||
endif()
|
||||
set(SSL_ENABLED ON)
|
||||
set(USE_OPENSSL ON)
|
||||
+ check_library_exists("rt" clock_gettime "" HAVE_LIBRT)
|
||||
+ if(HAVE_LIBRT)
|
||||
+ list(APPEND OPENSSL_LIBRARIES rt)
|
||||
+ endif()
|
||||
+ check_library_exists("pthread" pthread_once "" HAVE_PTHREAD)
|
||||
+ if(HAVE_PTHREAD)
|
||||
+ list(APPEND OPENSSL_LIBRARIES pthread)
|
||||
+ endif()
|
||||
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
14
tools/cmake/patches/130-bootstrap_parallel_make_flag.patch
Normal file
14
tools/cmake/patches/130-bootstrap_parallel_make_flag.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
--- a/bootstrap
|
||||
+++ b/bootstrap
|
||||
@@ -1420,7 +1420,10 @@ int main(){ printf("1%c", (char)0x0a); r
|
||||
' > "test.c"
|
||||
cmake_original_make_flags="${cmake_make_flags}"
|
||||
if test "x${cmake_parallel_make}" != "x"; then
|
||||
- cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
|
||||
+ case "$cmake_parallel_make" in
|
||||
+ [0-9]*) cmake_parallel_make="-j ${cmake_parallel_make}";;
|
||||
+ esac
|
||||
+ cmake_make_flags="${cmake_make_flags} ${cmake_parallel_make}"
|
||||
fi
|
||||
for a in ${cmake_make_processors}; do
|
||||
if test -z "${cmake_make_processor}" && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
|
||||
Reference in New Issue
Block a user