You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2023/12/06 15:22:37 UTC

(nifi-minifi-cpp) branch main updated (28cee7ece -> 513cb5f53)

This is an automated email from the ASF dual-hosted git repository.

martinzink pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


    from 28cee7ece MINIFICPP-2266 avoid using system versions of fmt and spdlog
     new 7ce91add1 MINIFICPP-2268 Remove FetchContent workaround for CMake<3.18
     new 513cb5f53 MINIFICPP-2267 - Add dynamic library to package on intel macos

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cmake/BundledOpenSSL.cmake    | 19 +++++++++++++------
 cmake/KubernetesClientC.cmake | 13 +++----------
 cmake/LZ4.cmake               | 11 ++---------
 cmake/MagicEnum.cmake         |  7 +------
 cmake/Zstd.cmake              | 13 +++----------
 5 files changed, 22 insertions(+), 41 deletions(-)


(nifi-minifi-cpp) 02/02: MINIFICPP-2267 - Add dynamic library to package on intel macos

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

martinzink pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 513cb5f5324d2ba8535daf4c9b73286efa8823a0
Author: Adam Debreceni <ad...@apache.org>
AuthorDate: Wed Dec 6 13:08:49 2023 +0100

    MINIFICPP-2267 - Add dynamic library to package on intel macos
    
    Closes #1700
    Signed-off-by: Martin Zink <ma...@apache.org>
---
 cmake/BundledOpenSSL.cmake | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/cmake/BundledOpenSSL.cmake b/cmake/BundledOpenSSL.cmake
index 9ec3ddee5..5b71a72e9 100644
--- a/cmake/BundledOpenSSL.cmake
+++ b/cmake/BundledOpenSSL.cmake
@@ -26,32 +26,39 @@ function(use_openssl SOURCE_DIR BINARY_DIR)
 
     # Define byproducts
     set(BYPRODUCT_PREFIX "lib" CACHE STRING "" FORCE)
+    set(OPENSSL_BUILD_SHARED "NO" CACHE STRING "" FORCE)
+
     if (WIN32)
         set(BYPRODUCT_SUFFIX ".lib" CACHE STRING "" FORCE)
     # Due to OpenSSL 3's static linking issue on x86 MacOS platform we make an exception to build a shared library instead
     elseif (APPLE AND (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64"))
         set(BYPRODUCT_SUFFIX ".dylib" CACHE STRING "" FORCE)
+        set(OPENSSL_BUILD_SHARED "YES" CACHE STRING "" FORCE)
     else()
         set(BYPRODUCT_SUFFIX ".a" CACHE STRING "" FORCE)
     endif()
 
-    if (APPLE AND (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64"))
-        set(OPENSSL_SHARED_FLAG "" CACHE STRING "" FORCE)
-    else()
-        set(OPENSSL_SHARED_FLAG "no-shared" CACHE STRING "" FORCE)
-    endif()
-
     set(BYPRODUCTS
             "${LIBDIR}/${BYPRODUCT_PREFIX}ssl${BYPRODUCT_SUFFIX}"
             "${LIBDIR}/${BYPRODUCT_PREFIX}crypto${BYPRODUCT_SUFFIX}"
             )
 
+    if (OPENSSL_BUILD_SHARED)
+        set(OPENSSL_SHARED_FLAG "" CACHE STRING "" FORCE)
+    else()
+        set(OPENSSL_SHARED_FLAG "no-shared" CACHE STRING "" FORCE)
+    endif()
+
     set(OPENSSL_BIN_DIR "${BINARY_DIR}/thirdparty/openssl-install" CACHE STRING "" FORCE)
 
     FOREACH(BYPRODUCT ${BYPRODUCTS})
         LIST(APPEND OPENSSL_LIBRARIES_LIST "${OPENSSL_BIN_DIR}/${BYPRODUCT}")
     ENDFOREACH(BYPRODUCT)
 
+    if (OPENSSL_BUILD_SHARED)
+        install(FILES ${OPENSSL_LIBRARIES_LIST} DESTINATION bin COMPONENT bin)
+    endif()
+
     # Define patch step
     set(PATCH_FILE "${SOURCE_DIR}/thirdparty/openssl/Tidy-up-aarch64-feature-detection-code-in-armcap.c.patch")
     set(PC ${Bash_EXECUTABLE} -c "set -x && \


(nifi-minifi-cpp) 01/02: MINIFICPP-2268 Remove FetchContent workaround for CMake<3.18

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

martinzink pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 7ce91add169ded37334336d75432be9ed8adbd67
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Wed Dec 6 13:08:22 2023 +0100

    MINIFICPP-2268 Remove FetchContent workaround for CMake<3.18
    
    Closes #1699
    Signed-off-by: Martin Zink <ma...@apache.org>
---
 cmake/KubernetesClientC.cmake | 13 +++----------
 cmake/LZ4.cmake               | 11 ++---------
 cmake/MagicEnum.cmake         |  7 +------
 cmake/Zstd.cmake              | 13 +++----------
 4 files changed, 9 insertions(+), 35 deletions(-)

diff --git a/cmake/KubernetesClientC.cmake b/cmake/KubernetesClientC.cmake
index 155e7b4ff..84671dced 100644
--- a/cmake/KubernetesClientC.cmake
+++ b/cmake/KubernetesClientC.cmake
@@ -55,17 +55,10 @@ set(K8S_PC ${Bash_EXECUTABLE} -c "set -x &&\
 FetchContent_Declare(kubernetes
     URL             https://github.com/kubernetes-client/c/archive/refs/tags/v0.5.0.tar.gz
     URL_HASH        SHA256=dbb6e6cd29ae2ac6c15de894aefb9b1e3d48916541d443f089aa0ffad6517ec6
-    PATCH_COMMAND "${K8S_PC}"
+    PATCH_COMMAND   "${K8S_PC}"
+    SOURCE_SUBDIR   kubernetes
 )
 
-# With CMake >= 3.18, this block could be replaced with FetchContent_MakeAvailable(kubernetes),
-# if we add the `SOURCE_SUBDIR kubernetes` option to FetchContent_Declare() [this option is not available in CMake < 3.18].
-# As of July 2022, one of our supported platforms, Centos 7, comes with CMake 3.17.
-FetchContent_GetProperties(kubernetes)
-if(NOT kubernetes_POPULATED)
-    FetchContent_Populate(kubernetes)
-    # the top level doesn't contain CMakeLists.txt, it is in the "kubernetes" subdirectory
-    add_subdirectory(${kubernetes_SOURCE_DIR}/kubernetes ${kubernetes_BINARY_DIR})
-endif()
+FetchContent_MakeAvailable(kubernetes)
 
 add_dependencies(websockets CURL::libcurl OpenSSL::Crypto OpenSSL::SSL)
diff --git a/cmake/LZ4.cmake b/cmake/LZ4.cmake
index 40260740b..53465dee3 100644
--- a/cmake/LZ4.cmake
+++ b/cmake/LZ4.cmake
@@ -25,17 +25,10 @@ set(BUILD_STATIC_LIBS ON CACHE BOOL "" FORCE)
 FetchContent_Declare(lz4
     URL            https://github.com/lz4/lz4/archive/refs/tags/v1.9.4.tar.gz
     URL_HASH       SHA256=0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b
+    SOURCE_SUBDIR  build/cmake
 )
 
-# With CMake >= 3.18, this block could be replaced with FetchContent_MakeAvailable(lz4),
-# if we add the `SOURCE_SUBDIR build/cmake` option to FetchContent_Declare() [this option is not available in CMake < 3.18].
-# As of July 2022, one of our supported platforms, Centos 7, comes with CMake 3.17.
-FetchContent_GetProperties(lz4)
-if(NOT lz4_POPULATED)
-    FetchContent_Populate(lz4)
-    # the top level doesn't contain CMakeLists.txt, it is in the "build/cmake" subdirectory
-    add_subdirectory(${lz4_SOURCE_DIR}/build/cmake ${lz4_BINARY_DIR})
-endif()
+FetchContent_MakeAvailable(lz4)
 
 add_library(lz4::lz4 ALIAS lz4_static)
 
diff --git a/cmake/MagicEnum.cmake b/cmake/MagicEnum.cmake
index b4bdd1e1a..266d3b849 100644
--- a/cmake/MagicEnum.cmake
+++ b/cmake/MagicEnum.cmake
@@ -21,9 +21,4 @@ FetchContent_Declare(magic_enum
         URL https://github.com/Neargye/magic_enum/archive/refs/tags/v0.9.3.tar.gz
         URL_HASH SHA256=3cadd6a05f1bffc5141e5e731c46b2b73c2dbff025e723c8abaa659e0a24f072)
 
-FetchContent_GetProperties(magic_enum)
-if(NOT magic_enum_POPULATED)
-    FetchContent_Populate(magic_enum)
-    add_library(magic_enum INTERFACE)
-    target_include_directories(magic_enum INTERFACE ${magic_enum_SOURCE_DIR}/include)
-endif()
+FetchContent_MakeAvailable(magic_enum)
diff --git a/cmake/Zstd.cmake b/cmake/Zstd.cmake
index debb209d9..52de9d1dd 100644
--- a/cmake/Zstd.cmake
+++ b/cmake/Zstd.cmake
@@ -28,18 +28,11 @@ endif()
 FetchContent_Declare(zstd
     URL            https://github.com/facebook/zstd/archive/refs/tags/v1.5.2.tar.gz
     URL_HASH       SHA256=f7de13462f7a82c29ab865820149e778cbfe01087b3a55b5332707abf9db4a6e
-    PATCH_COMMAND "${PC}"
+    PATCH_COMMAND  "${PC}"
+    SOURCE_SUBDIR  build/cmake
 )
 
-# With CMake >= 3.18, this block could be replaced with FetchContent_MakeAvailable(zstd),
-# if we add the `SOURCE_SUBDIR build/cmake` option to FetchContent_Declare() [this option is not available in CMake < 3.18].
-# As of July 2022, one of our supported platforms, Centos 7, comes with CMake 3.17.
-FetchContent_GetProperties(zstd)
-if(NOT zstd_POPULATED)
-    FetchContent_Populate(zstd)
-    # the top level doesn't contain CMakeLists.txt, it is in the "build/cmake" subdirectory
-    add_subdirectory(${zstd_SOURCE_DIR}/build/cmake ${zstd_BINARY_DIR})
-endif()
+FetchContent_MakeAvailable(zstd)
 
 add_library(zstd::zstd ALIAS libzstd_static)