From 789ba52ea538ddf5ac1a156d2c3cc911ca87c963 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 7 Nov 2024 12:21:00 +0100 Subject: [PATCH] [winpr,path] add Cwalk dependency --- cmake/ExternalProjectCwalk.cmake | 28 ++++++++++++++++++++++++++++ winpr/CMakeLists.txt | 2 ++ winpr/libwinpr/file/CMakeLists.txt | 2 ++ 3 files changed, 32 insertions(+) create mode 100644 cmake/ExternalProjectCwalk.cmake diff --git a/cmake/ExternalProjectCwalk.cmake b/cmake/ExternalProjectCwalk.cmake new file mode 100644 index 000000000..865c03e90 --- /dev/null +++ b/cmake/ExternalProjectCwalk.cmake @@ -0,0 +1,28 @@ +# Include Cwalk library as external project. +# +# Download from github and build the library. +include(FetchContent) + +# Disable -Werror for cwalk build unless we have set it +if (NOT ENABLE_WARNING_ERROR) + set(IGNORE_WARNINGS ON CACHE INTERNAL "[Cwalk] cached build variable") +endif() + +# If there is already a local copy of cwalk use it +if (EXISTS ${CMAKE_SOURCE_DIR}/external/cwalk) + set(FETCHCONTENT_SOURCE_DIR_CWALK ${CMAKE_SOURCE_DIR}/external/cwalk) +endif() + +FetchContent_Declare( + Cwalk + # URL https://github.com/likle/cwalk/archive/refs/tags/v1.2.9.tar.gz + # URL_HASH SHA256=54f160031687ec90a414e0656cf6266445207cb91b720dacf7a7c415d6bc7108 + + GIT_REPOSITORY https://github.com/likle/cwalk.git + GIT_TAG v1.2.9 + GIT_SHALLOW ON + OVERRIDE_FIND_PACKAGE +) + +FetchContent_MakeAvailable(Cwalk) + diff --git a/winpr/CMakeLists.txt b/winpr/CMakeLists.txt index 6bdff7cf2..b24e2edfd 100644 --- a/winpr/CMakeLists.txt +++ b/winpr/CMakeLists.txt @@ -18,6 +18,8 @@ # Include our extra modules set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/) +include(ExternalProjectCwalk) + if (NOT FREERDP_UNIFIED_BUILD) cmake_minimum_required(VERSION 3.13) diff --git a/winpr/libwinpr/file/CMakeLists.txt b/winpr/libwinpr/file/CMakeLists.txt index 0ff3928f8..2c63ab193 100644 --- a/winpr/libwinpr/file/CMakeLists.txt +++ b/winpr/libwinpr/file/CMakeLists.txt @@ -23,6 +23,8 @@ winpr_module_add( file.c ) +winpr_library_add_private(cwalk) + if(BUILD_TESTING_INTERNAL OR BUILD_TESTING) add_subdirectory(test) endif()